How to get total transaction amount of supplier for current fiscal year

In Sage X3, only posted transactions will be considered for accounting effects. Here in this blog we had a requirment from a client that , there should be a field on the header of purchase invoice screen, in which total transaction amount of the Supplier should be displayed for current fiscal year according to the PAN No of the Supplier.

For e.g., if a supplier 1 has XYZ PAN No. and supplier 2 also has XYZ PAN No., then same total transaction amount will be displayed in the Purchase invoice screen for supplier 1 as well as supplier 2.

To fullfil user’s requirment follow below steps:

Step 1: Add “Total invoice Amt for current fiscal yr “(ZINVAMT) field into (PINVOICE)table and (header) screen

New Stuff: Validation on Purchase Invoice screen

[Table]
[Table]

[Screen]
[Screen]

Step 2: Add below code into SPEPIH script

####################################################################################

Local DECIMAL A
Local DECIMAL B
Local DECIMAL C

Local Char REQUEST1(255)(8)
REQUEST1(0) = ” SELECT SUM(AMTATI_0) FROM “+nomap+”.PINVOICE P “
REQUEST1(1) = ” LEFT OUTER JOIN “+nomap+”.BPSUPPLIER BPS ON BPS.BPSNUM_0=P.BPR_0 “
REQUEST1(2) = ” LEFT OUTER JOIN “+nomap+”.BPSUPPLIER BPS1 ON BPS1.BPSNUM_0=’”+NUM$([M:PIH0]BPR)+”‘”
REQUEST1(3) = ” WHERE BPS.XX1P4PANNO_0=BPS1.XX1P4PANNO_0 AND P.STA_0= ‘3’ AND P.ACCDAT_0 BETWEEN DateFromParts((CASE WHEN MONTH(‘”+[M:PIH0]ACCDAT+”‘) IN(1,2,3) THEN (YEAR(‘”+[M:PIH0]ACCDAT+”‘)-1) ELSE YEAR(‘”+[M:PIH0]ACCDAT+”‘) END),04,01) and ‘”+[M:PIH0]ACCDAT+”‘ “
REQUEST1(4) = ” GROUP BY BPS1.XX1P4PANNO_0″
FOR (DECIMAL DTEXTE_0) FROM “5” Sql REQUEST1 As [YCHD]
A =[YCHD]DTEXTE_0
NEXT

C=A-B
[M:PIH0]ZINVAMT=C
AFFZO[M:PIH0]ZINVAMT

######################################################################

Step 3: Compile SPEPIH script

[Output]
[Output]

Now after validation of script, when user will create new purchase invoice, the total transaction amount of the posted invoices created against the supplier for the current fiscal year according to PAN No gets calculated and displayed in the ZINVAMT field as shown in above screenshot.

About Us

Greytrix – a globally recognized and one of the oldest Sage Development Partner is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development and implementation competence.

Greytrix caters to a wide range of Sage X3, a Sage Business Cloud Solution, offerings. Our unique GUMU™ integrations include Sage X3 for Sage CRMSalesforce.com, Dynamics 365 CRM and Magento eCommerce along with Implementation and Technical Support worldwide for Sage X3. Currently we are Sage X3 Implementation Partner in East Africa, Middle East, Australia, Asia, US, UK. We also offer best-in-class Sage X3 customization and development services, integrated applications such as POS | WMS | Payment Gateway | Shipping System | Business Intelligence | eCommerce and have developed add-ons such as Catch – Weight  and Letter of Credit and India Legislation for Sage X3 to Sage business partners, end users and Sage PSG worldwide.

Greytrix is a recognized Sage champion ISV Partner for GUMU™ Sage X3 – Sage CRM integration also listed on Sage Marketplace; GUMU™ integration for Sage X3 – Salesforce is a 5-star rated app listed on Salesforce AppExchange and GUMU™ integration for Dynamics 365 CRM – Sage ERP listed on Microsoft AppSource.

For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com, We will like to hear from you.