Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Limit Items (stock) to one Debtor/Customer
06-27-2015, 06:29 AM,
#1
Limit Items (stock) to one Debtor/Customer
Good day,

I'm making progress on importing stock into my new system.

I'm wondering if there is a way to limit the purchase of certain stock items to one customer.

Currently the company sells item 'ABC' to one customer only as a 'Private Label' item, and the EAN/JAN on the packaging is specific to that customer, thus I should not sell that item to a competitor, unless I am able to change the UPC code from Customer 'HC' to the UPC code used by Customer 'FD'.

Pricing may or may not be different for each customer, depends on volume. I'm thinking at this point the simplest solution would be to prepend the customer code, say 'HC' to the item code, 'HC-ABC' and establish an 'HC' sales type (price list).

I do see that it is possible using the 'custitems' table and the 'Maintain Customer Item Data' link to track the Debtor's Item Code for the item as well as the debtor's item description. Perhaps I could use the 'Item Description' field to store the unique UPC Code?

Suggestions?

Thanks,

Joe
Reply
06-27-2015, 12:31 PM,
#2
RE: Limit Items (stock) to one Debtor/Customer
Hi, Joe,

I think the simple solution is to change the SQL of item selection on around line 723~734
$SQL = "SELECT stockmaster.stockid,
stockmaster.description,
stockmaster.longdescription,
stockmaster.units,
custitem.cust_part,
custitem.cust_description
FROM stockmaster INNER JOIN stockcategory
ON stockmaster.categoryid=stockcategory.categoryid
" . $IncludeCustItem . "
WHERE (stockcategory.stocktype='F' OR stockcategory.stocktype='D' OR stockcategory.stocktype='L' " . $RawMaterialSellable . ")
AND stockmaster.mbflag <>'G'
AND stockmaster.discontinued=0
AND stockmaster.stockid NOT IN (SELECT stockid FROM custitem WHERE debtorno != '" . $_SESSION['Items'.$identifier]->DebtorNo . "' GRROUP BY stockid)";

You can put the customer excluded items into the custitem table.
It's not tested. But hope it does work.
Best regards!
Exson


Reply
06-27-2015, 01:17 PM,
#3
RE: Limit Items (stock) to one Debtor/Customer
Thanks Exson,

I decided I should put some version control in place and start getting my hands dirty. I appreciate your help with the php, I am a neophyte. I'll test out what you've given me this weekend.

Joe
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)