projects
/
fa-stable.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4232965
)
[0000101] More wonderful rounding issues. Rerun.
author
Joe Hunt
<joe.hunt.consulting@gmail.com>
Thu, 18 Dec 2008 01:12:28 +0000
(
01:12
+0000)
committer
Joe Hunt
<joe.hunt.consulting@gmail.com>
Thu, 18 Dec 2008 01:12:28 +0000
(
01:12
+0000)
CHANGELOG.txt
patch
|
blob
|
history
purchasing/includes/db/invoice_db.inc
patch
|
blob
|
history
purchasing/includes/db/supp_payment_db.inc
patch
|
blob
|
history
sales/includes/db/payment_db.inc
patch
|
blob
|
history
sales/includes/db/sales_credit_db.inc
patch
|
blob
|
history
sales/includes/db/sales_invoice_db.inc
patch
|
blob
|
history
diff --git
a/CHANGELOG.txt
b/CHANGELOG.txt
index 40d481ce216c664eaadb55f5bab0122471262b69..d3e6efd1dc04319ffb8cfaa64705d081c6d32566 100644
(file)
--- a/
CHANGELOG.txt
+++ b/
CHANGELOG.txt
@@
-23,6
+23,8
@@
$ -> Affected files
# [0000101] More wonderful rounding issues
$ /includes/ui/ui_view.inc
/purchasing/includes/db/invoice_db.inc
# [0000101] More wonderful rounding issues
$ /includes/ui/ui_view.inc
/purchasing/includes/db/invoice_db.inc
+ /purchasing/includes/db/supp_payment_db.inc
+ /sales/includes/db/payment_db.inc
/sales/includes/db/sales_credit_db.inc
/sales/includes/db/sales_delivery_db.inc
/sales/includes/db/sales_invoice_db.inc
/sales/includes/db/sales_credit_db.inc
/sales/includes/db/sales_delivery_db.inc
/sales/includes/db/sales_invoice_db.inc
diff --git
a/purchasing/includes/db/invoice_db.inc
b/purchasing/includes/db/invoice_db.inc
index f69ebe404332c9851e05cbfbcbaad3338101030b..05704c3a02b272de543a1acc0031518db526a006 100644
(file)
--- a/
purchasing/includes/db/invoice_db.inc
+++ b/
purchasing/includes/db/invoice_db.inc
@@
-145,10
+145,6
@@
function add_supp_invoice($supp_trans) // do not receive as ref because we chang
$total = 0;
/* Now the control account */
$supplier_accounts = get_supplier_accounts($supp_trans->supplier_id);
$total = 0;
/* Now the control account */
$supplier_accounts = get_supplier_accounts($supp_trans->supplier_id);
- $total += add_gl_trans_supplier($trans_type, $invoice_id, $date_, $supplier_accounts["payable_account"], 0, 0,
- -($invoice_items_total + $tax_total + $supp_trans->ov_discount),
- $supp_trans->supplier_id,
- "The general ledger transaction for the control total could not be added");
/*Loop through the GL Entries and create a debit posting for each of the accounts entered */
/*Loop through the GL Entries and create a debit posting for each of the accounts entered */
@@
-263,6
+259,10
@@
function add_supp_invoice($supp_trans) // do not receive as ref because we chang
}
}
}
}
+ $total += add_gl_trans($trans_type, $invoice_id, $date_, $supplier_accounts["payable_account"], 0, 0, "",
+ -$total, null, payment_person_types::supplier(), $supp_trans->supplier_id,
+ "The general ledger transaction for the control total could not be added");
+
/*Post a balance post if $total != 0 */
add_gl_balance($trans_type, $invoice_id, $date_, -$total, payment_person_types::supplier(), $supp_trans->supplier_id);
/*Post a balance post if $total != 0 */
add_gl_balance($trans_type, $invoice_id, $date_, -$total, payment_person_types::supplier(), $supp_trans->supplier_id);
diff --git
a/purchasing/includes/db/supp_payment_db.inc
b/purchasing/includes/db/supp_payment_db.inc
index 48e4c8cb774d4b978a9ec00a3b043bd1f18d263a..ea9430cac98a0cb17e282833186d82ce53f138bb 100644
(file)
--- a/
purchasing/includes/db/supp_payment_db.inc
+++ b/
purchasing/includes/db/supp_payment_db.inc
@@
-31,8
+31,6
@@
function add_supp_payment($supplier_id, $date_, $payment_type, $bank_account,
$total = 0;
$supplier_accounts = get_supplier_accounts($supplier_id);
$total = 0;
$supplier_accounts = get_supplier_accounts($supplier_id);
- $total += add_gl_trans_supplier($trans_type, $payment_id, $date_, $supplier_accounts["payable_account"], 0, 0,
- $supp_amount + $supp_discount, $supplier_id, "", $rate);
// Now credit discount received account with discounts
if ($supp_discount != 0)
// Now credit discount received account with discounts
if ($supp_discount != 0)
@@
-47,6
+45,10
@@
function add_supp_payment($supplier_id, $date_, $payment_type, $bank_account,
-$supp_amount, $supplier_id, "", $rate);
}
-$supp_amount, $supplier_id, "", $rate);
}
+ $total += add_gl_trans($trans_type, $payment_id, $date_, $supplier_accounts["payable_account"], 0, 0, "",
+ -$total, null, payment_person_types::supplier(), $supplier_id,
+ "The general ledger transaction for the control total could not be added");
+
/*Post a balance post if $total != 0 */
add_gl_balance($trans_type, $payment_id, $date_, -$total, payment_person_types::supplier(), $supplier_id);
/*Post a balance post if $total != 0 */
add_gl_balance($trans_type, $payment_id, $date_, -$total, payment_person_types::supplier(), $supplier_id);
diff --git
a/sales/includes/db/payment_db.inc
b/sales/includes/db/payment_db.inc
index 75392b6a2d303f368edec2ef1ff0cf59f1cc1120..e31c432d49db9d501780b1882966c57a064453d0 100644
(file)
--- a/
sales/includes/db/payment_db.inc
+++ b/
sales/includes/db/payment_db.inc
@@
-36,12
+36,6
@@
function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
$discount_account = $company_record["default_prompt_payment_act"];
}
$discount_account = $company_record["default_prompt_payment_act"];
}
- if (($discount + $amount) != 0) {
- /* Now Credit Debtors account with receipts + discounts */
- $total += add_gl_trans_customer(12, $payment_no, $date_,
- $debtors_account, 0, 0, -($discount + $amount), $customer_id,
- "Cannot insert a GL transaction for the debtors account credit", $rate);
- }
if ($discount != 0) {
/* Now Debit discount account with discounts allowed*/
$total += add_gl_trans_customer(12, $payment_no, $date_,
if ($discount != 0) {
/* Now Debit discount account with discounts allowed*/
$total += add_gl_trans_customer(12, $payment_no, $date_,
@@
-49,6
+43,13
@@
function write_customer_payment($trans_no, $customer_id, $branch_id, $bank_accou
"Cannot insert a GL transaction for the payment discount debit", $rate);
}
"Cannot insert a GL transaction for the payment discount debit", $rate);
}
+ if (($discount + $amount) != 0) {
+ /* Now Credit Debtors account with receipts + discounts */
+ $total += add_gl_trans(12, $payment_no, $date_, $debtors_account, 0, 0, "",
+ -$total, null, payment_person_types::customer(), $customer_id,
+ "Cannot insert a GL transaction for the debtors account credit");
+ }
+
/*Post a balance post if $total != 0 */
add_gl_balance(12, $payment_no, $date_, -$total, payment_person_types::customer(), $customer_id);
/*Post a balance post if $total != 0 */
add_gl_balance(12, $payment_no, $date_, -$total, payment_person_types::customer(), $customer_id);
diff --git
a/sales/includes/db/sales_credit_db.inc
b/sales/includes/db/sales_credit_db.inc
index dfb4c21b1ce244cc88c2431fbc07eed2858db591..9b38763730e6cc63bc40a07fdd0968efe7d72cbd 100644
(file)
--- a/
sales/includes/db/sales_credit_db.inc
+++ b/
sales/includes/db/sales_credit_db.inc
@@
-127,14
+127,6
@@
function write_credit_note($credit_note, $write_off_acc)
/*Post credit note transaction to GL credit debtors,
debit freight re-charged and debit sales */
/*Post credit note transaction to GL credit debtors,
debit freight re-charged and debit sales */
- if (($credit_note_total + $credit_note->freight_cost) != 0) {
-
- $total += add_gl_trans_customer(11, $credit_no, $credit_date, $branch_data["receivables_account"], 0, 0,
- -($credit_note_total + $credit_note->freight_cost + $items_added_tax + $freight_added_tax),
- $credit_note->customer_id,
- "The total debtor GL posting for the credit note could not be inserted");
- }
-
if ($credit_note->freight_cost !=0) {
$total += add_gl_trans_customer(11, $credit_no, $credit_date, $company_data["freight_act"], 0, 0,
$credit_note->get_tax_free_shipping(), $credit_note->customer_id,
if ($credit_note->freight_cost !=0) {
$total += add_gl_trans_customer(11, $credit_no, $credit_date, $company_data["freight_act"], 0, 0,
$credit_note->get_tax_free_shipping(), $credit_note->customer_id,
@@
-152,6
+144,13
@@
function write_credit_note($credit_note, $write_off_acc)
"A tax GL posting for this credit note could not be inserted");
}
}
"A tax GL posting for this credit note could not be inserted");
}
}
+ if (($credit_note_total + $credit_note->freight_cost) != 0) {
+
+ $total += add_gl_trans(11, $credit_no, $credit_date, $branch_data["receivables_account"], 0, 0, "",
+ -$total, null, payment_person_types::customer(), $credit_note->customer_id,
+ "The total debtor GL posting for the credit note could not be inserted");
+ }
+
/*Post a balance post if $total != 0 */
add_gl_balance(11, $credit_no, $credit_date, -$total, payment_person_types::customer(), $credit_note->customer_id);
/*Post a balance post if $total != 0 */
add_gl_balance(11, $credit_no, $credit_date, -$total, payment_person_types::customer(), $credit_note->customer_id);
diff --git
a/sales/includes/db/sales_invoice_db.inc
b/sales/includes/db/sales_invoice_db.inc
index 87b9eb7ec580bc0b78f5da9971d903423e670ab4..0dc6de5655a76bf1a8a860095a7309e28304144c 100644
(file)
--- a/
sales/includes/db/sales_invoice_db.inc
+++ b/
sales/includes/db/sales_invoice_db.inc
@@
-122,12
+122,6
@@
function write_sales_invoice(&$invoice)
} /*quantity dispatched is more than 0 */
} /*end of delivery_line loop */
} /*quantity dispatched is more than 0 */
} /*end of delivery_line loop */
- if (($items_total + $charge_shipping) != 0) {
- $total += add_gl_trans_customer(10, $invoice_no, $date_, $branch_data["receivables_account"], 0, 0,
- ($items_total + $charge_shipping + $items_added_tax + $freight_added_tax),
- $invoice->customer_id, "The total debtor GL posting could not be inserted");
- }
-
if ($charge_shipping != 0) {
$total += add_gl_trans_customer(10, $invoice_no, $date_, $company_data["freight_act"], 0, 0,
-$invoice->get_tax_free_shipping(), $invoice->customer_id,
if ($charge_shipping != 0) {
$total += add_gl_trans_customer(10, $invoice_no, $date_, $company_data["freight_act"], 0, 0,
-$invoice->get_tax_free_shipping(), $invoice->customer_id,
@@
-145,6
+139,11
@@
function write_sales_invoice(&$invoice)
}
}
}
}
+ if (($items_total + $charge_shipping) != 0) {
+ $total += add_gl_trans(10, $invoice_no, $date_, $branch_data["receivables_account"], 0, 0, "",
+ -$total, null, payment_person_types::customer(), $invoice->customer_id, "The total debtor GL posting could not be inserted");
+ }
+
/*Post a balance post if $total != 0 */
add_gl_balance(10, $invoice_no, $date_, -$total, payment_person_types::customer(), $invoice->customer_id);
/*Post a balance post if $total != 0 */
add_gl_balance(10, $invoice_no, $date_, -$total, payment_person_types::customer(), $invoice->customer_id);