webERP Forum

Full Version: Post Tax to Stockmoves
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have created a column in the stockmoves table named item_tax and am trying to post the tax for each line item in this the table.
The reason for this we have some items, that are not taxable in some states but not others so making the item taxable or not is not an option and I need to generate a report that shows the tax by item for each customer.
I can get the code to post the tax total to each item but not just the tax for that line.

Here is the line of code around line 413 of ConfirmDispatch_invoice.php
//Added line tax to post to stockmoves

$LineTax = locale_number_format($TaxLineTotal ,$_SESSION['Items'.$identifier]->CurrDecimalPlaces);

And here is the Insert INto the table around line 1031

$SQL = "INSERT INTO stockmoves (stockid,
type,
transno,
loccode,
trandate,
userid,
debtorno,
branchcode,
prd,
reference,
qty,
standardcost,
show_on_inv_crds,
newqoh,
item_tax)
VALUES ('" . $AssParts['component'] . "',
10,
'" . $InvoiceNo . "',
'" . $_SESSION['Items'.$identifier]->Location . "',
'" . $DefaultDispatchDate . "',
'" . $_SESSION['UserID'] . "',
'" . $_SESSION['Items'.$identifier]->DebtorNo . "',
'" . $_SESSION['Items'.$identifier]->Branch . "',
'" . $PeriodNo . "',
'" . _('Assembly') . ': ' . $OrderLine->StockID . ' ' . _('Order') . ': ' . $_SESSION['ProcessingOrder'] . "',
'" . -$AssParts['quantity'] * $OrderLine->QtyDispatched . "',
'" . $AssParts['standard'] . "',
0,
'" . ($QtyOnHandPrior - $AssParts['quantity'] * $OrderLine->QtyDispatched) . "',
'" . $LineTax . "')";

Thanks to ALL
Hi Dave,
Well this is whey we have a taxgroup against the customer branch - so you can show only the taxes relevant for this customer branch. You need to create tax groups with the various permutations of taxes applicable. If no tax is applicable you may need to create a tax group with just a single tax authority with rates all zip.
Phil
Thanks for the help I think I understand the groups and rates, the issues is there is some customers that purchase several items and there may be some items that they collect the tax on because they buy them for resale, so they collect the tax on those items. When an invoice is processed the tax is reduced to 0.00 for the resale items and we need to capture those 0.00 sales.
Thanks
Dave