Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/06/2014 in all areas

  1. I made this mod in response to another thread but I figured it would be best to cross post it here. If that's not allowed then please remove this thread. When you add a payment manually, it will automatically apply the payment to the invoices, oldest first. It will check any invoices with an amount above zero. E.g. if the client has three invoices - $30 and $10, and $20 and paid $37, $30 will be paid to the first invoice and $7 to the second. The third invoice will be unpaid. Note: this doesn't actually add any real functionality to Blesta, it will just make it easier to apply the payments without having to work out manually how much to apply to each invoice. /app/views/admin/default/admin_clients_recordpayment.pdt After line 79 $(document).ready(function() { add: $("#amount").change(function() { amountRemaining = Math.max($(this).val(), 0); if (!isNaN(amountRemaining)) { $("#invoices_to_pay").find("tr").not(".heading_row").each(function() { checkBoxElement = $(this).find("input[name^=\'invoice_id\']"); applyAmountElement = $(this).find("input[name^=\'applyamount\']"); amountDueElement = applyAmountElement.parent().next(); amountDue = Number(amountDueElement.text().substr(1).replace(/[^0-9\.]+/g, "")); applyAmount = Math.min(amountRemaining, amountDue); amountRemaining = (amountRemaining - applyAmount).toFixed(2); applyAmountElement.val(applyAmount); checkBoxElement.prop("checked", applyAmount > 0); if (!amountRemaining) return false; }); } }); If you want the calc to run while typing, change line 80 to: $("#amount").on("input",function() { Just be aware that this is unsupported or buggy on older browsers. apply_payments_calc.xml
    1 point
  2. I think I fixed it by accident to be honest. I seemed to have fixed it with the following: ######################################################## # package: minPHP # filename: .htaccess ######################################################## <Files ~ "\.(pdt)$"> order deny,allow deny from all </Files> # Protect against Clickjacking Header append X-Frame-Options "SAMEORIGIN" RewriteEngine on # Force HTTPS RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://my.hostmyheart.com/$1 [R,L] #RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php RewriteCond %{REQUEST_URI} ^(.*)/install.php$ RewriteRule install.php %1/install/ [R=301,L]
    1 point
  3. Max

    Processing Payment

    >We want the ability to simply have a running total. Wouldn't that complicates things when sending payment reminders? Note that while you do have to record it against some invoice in Blesta, it is not a problem if it is a partial payment. And you can also record a payment that is greater than the invoices you apply it to, in which case it will be recorded as credit to be applied to future invoices. after: That is a wire transfer that the customer sends from his bank account to your bank account using Internet banking. Popular in countries were credit cards are not common, where cards are restricted to offline use, and/or where people simply do not feel comfortable supplying their card details to some random shop online (quite a significant part of continental Europe) There do are gateways that can process those for you (e.g. Multisafepay), but most companies prefer to receive the payments in their own bank account, and process them manually by looking at their bank statement. Or semi-manually by exporting them from Internet banking (usually as CSV file) and importing them into accounting software that does some matching.
    1 point
  4. flangefrog

    Processing Payment

    Would something like this work? When you add a payment manually, it will automatically apply the payment to the invoices, oldest first. It will check any invoices with an amount above zero. E.g. if the client has three invoices - $30 and $10, and $20 and paid $37, $30 will be paid to the first invoice and $7 to the second. The third invoice will be unpaid. Note: this doesn't actually add any real functionality to Blesta, it will just make it easier to apply the payments without having to work out manually how much to apply to each invoice. /app/views/admin/default/admin_clients_recordpayment.pdt After line 79 $(document).ready(function() { add: $("#amount").change(function() { amountRemaining = Math.max($(this).val(), 0); if (!isNaN(amountRemaining)) { $("#invoices_to_pay").find("tr").not(".heading_row").each(function() { checkBoxElement = $(this).find("input[name^=\'invoice_id\']"); applyAmountElement = $(this).find("input[name^=\'applyamount\']"); amountDueElement = applyAmountElement.parent().next(); amountDue = Number(amountDueElement.text().substr(1).replace(/[^0-9\.]+/g, "")); applyAmount = Math.min(amountRemaining, amountDue); amountRemaining = (amountRemaining - applyAmount).toFixed(2); applyAmountElement.val(applyAmount); checkBoxElement.prop("checked", applyAmount > 0); if (!amountRemaining) return false; }); } }); If you want the calc to run while typing, change line 80 to: $("#amount").on("input",function() { Just be aware that this is unsupported or buggy on older browsers.
    1 point
×
×
  • Create New...