Shipping to Customer and Auto Invoicing

Proposal summary

AMVOP would like to build an auto-invoicing process and restrict the invoice view permission for a particular user and role in the system. Also, this scope includes some pdf updates and dynamic user assignments.

Requirement

  1. When the user 1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman creates the item fulfillment to the customer, the system should automatically create the invoice related to this item fulfillment with the exact fulfilled quantity. 
  2. And need to print the invoice number on the delivery order and to print the DO number on the invoice. 
  3. Also, the AMVOP warehouseman role and user should not see any invoice record.
  4. And if the user changed we should be able to apply the same restriction and invoice auto-generation.

Our Solution

Auto- invoicing

This requirement can be achieved by deploying a script in Item Fulfillment. We consider a Real-time Process: 

  • For those Item fulfillments saved with “Shipped” status created by 1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman, Script will create an invoice by transforming the SO with matching items and quantities in IF that are shipped (here we should eliminate the lines from SO that are not available in the corresponding IF and it has zero quantity in the created invoice). 
  • The script will be triggered in these 3 contexts.
  1. User (1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman) creates IF with “Shipped” status.
  2. User (1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman) edit and save the IF with “Shipped” status and the previous status of record is not equal to “Shipped”.
  3. User (1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman) on clicking the button “MARK SHIPPED” on record Status in IF changed to “Shipped.
  • We have to also add the logic to link the IF to the corresponding Invoice and linking of Invoice to the IF (linking of Invoice to the IF is already in place; this works for manually created Invoices; we need to include this in the auto invoicing script too ). This is for the second requirement. 
  • The type of Custom form (Local/Export) in the invoice created should follow the one in the created from sales order of IF, as given below
  1. Primary Sales Order (Local) in SO : : AMVOP Commercial invoice (Local) in Invoice
  2. Primary Sales Order (Export) in SO : : AMVOP Commercial invoice (Export) in Invoice
    (Since we are transforming the SO this pattern will be followed. This is to make sure the correct pdf is generated for the invoice)

PDF Updates: 

  • Need to format the current preferred Invoice pdfs to include IF Document Number.
  • We will create a new field in the Invoice record and add this value in the preferred Advanced PDF Template ‘Commercial Invoice (Export)’ instead of value from the field DELIVERY ORDER NO. (id: custbody_az_mn_trans_deliverynum) inside Invoice.
  • Similarly for the Commercial Invoice (Local) template too.

Restrict Access to Invoice

  • Will will add a script in invoice record to restrict the user 1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman access to all invoices upon viewing the record.

Dynamic User Assignment

  • We will create 2 fields “Invoice Automation User” for selecting the user for whom the invoice auto-generation script runs and “Invoice Restricted User” for selecting the user to restrict viewing invoices,  in General Preference. 

Navigation: Setup> Company> General Preference. Fields created lies under Custom Preferences where users can select the Employee from the dropdown.

Assumptions

  • We propose a real time Auto Invoicing process. So for those Sales orders Item Fulfillments & invoices exist in pairs.
  • While transforming SO into Invoice we will consider only Assembly and Inventory items.
    AMVOP confirmed that as of now, they only have one service item “Shipping Charges”, and they will create it manually from the SO.
  • In the initial development, we will check the user is 1052 Ahmed Mustafa Alkashif and AMVOP warehouseman only.
  • We have only considered changing the sourcing into the Delivery Order No: Advanced PDF Template of Commercial Invoice (Export) & Commercial Invoice (Local).
  • Formating the current preferred Item Fulfillment (packing Slip) pdf to include Invoice Number – the customisation for this is already in place.

Risks 

  • There is no system link between an Invoice and an Item Fulfillment. Sales Orders are linked to one or more Item Fulfillments, and one or more Invoices, but as far as NetSuite is concerned there is nothing connecting any specific fulfillment to any specific invoice. In fact you could have products from multiple fulfillments that are invoiced together, or vice versa, a single fulfillment with multiple invoices. So we are handling this in the script for the auto generated invoices through script. The linking will  not take place if the user creates the Invoice from UI.
  • For those IFs created by 1052 Ahmed Mustafa Alkashif with the role AMVOP warehouseman and their automated Invoices, will have values in prints; As in others, it lacks Item Fulfillment-Invoice pairing.
  • For Other unfulfillable types of items(eg: service item, discount item etc.) as they are not shipped (not included in IF), but on direct invoicing from SO, will include these items; So on transforming SO it will include all types of items in it. Hence it is risky when partial Fulfillment occurs. Thus we consider only assembly and inventory type items and will exclude all other types of items that are of not fulfillable type.
    In case Service item/discount item arrives in SO AMVOP will manually add them to the corresponding auto generated invoice.
    So we have to check the item type and rate/amount column other than the order line and quantity here. 
  • In case of deletion of the auto created invoices user has to edit & save the corresponding IF to trigger the auto invoicing script

Leave a comment

Your email address will not be published. Required fields are marked *