X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fincludes%2Fdb%2Finvoice_db.inc;h=8fdfda7fec8f2ca5529a0eaac7f6bd5c883e4b1b;hb=f11b39846d81bd043490ba9596224b859e47467c;hp=eadf5724a8a5ee1c2d9209d3ce2c470430606a87;hpb=020d309dc37e9400d27ef3cad381e6f1b04f67fd;p=fa-stable.git diff --git a/purchasing/includes/db/invoice_db.inc b/purchasing/includes/db/invoice_db.inc index eadf5724..8fdfda7f 100644 --- a/purchasing/includes/db/invoice_db.inc +++ b/purchasing/includes/db/invoice_db.inc @@ -135,7 +135,7 @@ function add_supp_invoice(&$supp_trans) $tax_total = 0; $taxes = $supp_trans->get_taxes($supp_trans->tax_group_id); if ($trans_no) { - $allocs = get_payments_for($trans_no, $trans_type); // save allocations + $allocs = get_payments_for($trans_no, $trans_type, $supp_trans->supplier_id); // save allocations void_transaction($trans_type, $trans_no, Today(), _("Document reentered.")); $Refs->restore_last($trans_type, $trans_no); } else @@ -393,11 +393,7 @@ function add_supp_invoice(&$supp_trans) } } -//_vd($allocs); - reallocate_payments($invoice_id, ST_SUPPINVOICE, $date_, $to_allocate, $allocs); -//_vd(get_payments_for($sales_order, ST_PURCHORDER)); -//_vd(get_payments_for($invoice_id, ST_SUPPINVOICE)); -//exit; + reallocate_payments($invoice_id, ST_SUPPINVOICE, $date_, $net_total+$tax_total, $allocs, $supp_trans->supplier_id); $supp_trans->trans_no = $invoice_id; hook_db_postwrite($supp_trans, $supp_trans->trans_type); commit_transaction();