webERP Forum
Post Tax to Stockmoves - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Development Discussion & Specification (/forumdisplay.php?fid=10)
+--- Thread: Post Tax to Stockmoves (/showthread.php?tid=7866)



Post Tax to Stockmoves - daveparrish - 09-01-2017 03:34 AM

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


RE: Post Tax to Stockmoves - phil - 09-01-2017 07:39 AM

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.


RE: Post Tax to Stockmoves - daveparrish - 09-05-2017 11:15 PM

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