Entry points >  Module Purchasing >  Standard script SUBPIHA  

Display all Hide all

CALECHE: Modification of the open items generated at the time of creating a sale

This entry point is located in the SUBPIHAprocess saving of a purchase invoice, generates a "CALECHE" action.

The goal of this action is to give the possibility to intervene in the open items created in order to modify the dates, amounts, payment methods …etc.

Context and operating mode

Transaction

There is a transaction in process: it is possible to cancel the transaction by setting the GOK to 0.

Log file

There is no open log file.

Different call cases

The call is made after the write or re-write of the invoice header ([F :PIH] and [F :PIV]) following the use of the "Create" or "Save" key.

In all the cases the two invoice headers, the detail lines and the open item have been created.

Available variables and masks

The following screen masks can be used: [M:PIH0], [M:PIH1], [M:PIH2], [M:PIH3], [M:PIH4]

The classes given above must not be modified.

Open tables

In the table below, the significant content flag indicates that the content matches the context.

Table

Significant content

Table Title

PINVOICE

Yes

Invoice header

PINVOICEV

Yes

Additional purchase invoice header

PINVOICED

No

Purchase invoice lines

BPARTNER

No

BP

BPSUPPLIER

No

Suppliers

Miscellaneous remarks

Caution: the GACCDUDATE table containing the open items is only open if the GREP = "C".

It is preferable to execute the following instruction before using this table:

If !clalev([F:DUD]) Local File GACCDUDATE [DUD] : Endif

CPRFAC: Unitary production cost

This entry point is located in the SUBPIHAprocess saving of a purchase invoice, generates a "CPRFAC" action.

The goal of this action is to give the possibility to intervene in the calculated unitary production code to add additional charges for example.

Context and operating mode

Transaction

There is one transaction in progress.

Log file

There is no open log file.

Different call cases

The call is made before the write or re-write of the invoice line after having used the "Create" or "Save" key.

Available variables and masks

The following variable is loaded at the time of the call to the "CPRFAC" action.

NOL

Index for the invoice line being processed (can be used with the [M:PIH3] class).

The following screen masks can be used: [M:PIH0], [M:PIH1], [M:PIH2], [M:PIH3], [M:PIH4]

The variable and the classes given above must not be modified.

[F:PID]CPR

Calculated unitary production price, which can be modified by the entry point in order take into account other elements.

Open tables

In the table below, the significant content flag indicates that the content matches the context.

Table

Significant content

Table Title

PINVOICE

Yes

Invoice header

PINVOICEV

Yes

Additional purchase invoice header

PINVOICED

Yes

Purchase invoice lines

Miscellaneous remarks

This entry point is not called for additional invoices and credit notes in amount.

MAJFAC: Loading or modification of fields before the write

This entry point is located in the SUBPIHAprocess saving of a purchase invoice, generates a "MAJFAC" action.

The goal of this actions is to give the possibility to load the specific/custom fields or to modify the standard fields in the tables updated by invoice control.

Context and operating mode

Transaction

There is one transaction in progress.

Log file

There is no open log file.

Different call cases

The call is made before the re-write for each table update during the saving of a purchase invoice.

Available variables and masks

The following variables are loaded at the time of the call to the "MAJFAC" action.

FICHIER

Name of the table that will be rewritten (PORDERQ, PORDERC, PORDER, PRECEIPTD, PRECEIPT, PRETURND, PRETURN).

ABRFIC

Abbreviation for the table that will be rewritten (POQ, POC, POH, PTD, PTH, PND, PNH).

The following screen masks can be used: [M:PIH0], [M:PIH1], [M:PIH2], [M:PIH3], [M:PIH4]

The following file classes are loaded: [F:PIH], [F:PIV] and [F:PID]

The variables and the classes given above must not be modified.

The following classes can be modified in order to populate specific fields and/or modify standard fields.

[F:POQ] if FICHIER = "PORDERQ" and ABRFIC = "POQ"

[F:POC] if FICHIER = "PORDERC" and ABRFIC = "POC"

[F:POH] if FICHIER = "PORDER" and ABRFIC = "POH"

[F:PTD] if FICHIER = "PRECEIPTD" and ABRFIC = "PTD"

[F:PTH] if FICHIER = "PRECEIPT" and ABRFIC = "PTH"

[F:PND] if FICHIER = "PRETURND" and ABRFIC = "PND"

[F:PNH] if FICHIER = "PRETURN" and ABRFIC = "PNH"

It is advisable to modify the standard fields with extreme prudence to avoid later malfunctioning.

Open tables

In the table below, the significant content flag indicates that the content matches the context.

Table

Significant content

Table Title

PINVOICE

Yes

Invoice header

PINVOICEV

Yes

Additional purchase invoice header

PINVOICED

Yes

Purchase invoice lines

ITMMASTER

Yes

Products

Miscellaneous remarks

This entry point is called for all the invoice types.

[M:PIH0]PIHTYP (1=invoice, 2=additional invoice, 3=credit note, 4=credit note on return)

MAJRCPCDE: Update of receipts and orders after credit memo

This entry point, which is located in the SUBPIHAprocess for saving a purchase invoice, generates a "MAJRCPCDE" action.

When creating or modifying a credit memo line, the order and the receipts are set to Not invoiced.

The purpose of this action is to make it possible to avoid updating the receipts and orders when creating/modifying a credit memo line.

Context and operating mode

Transaction

There is one transaction in progress.

Log file

There is no open log file.

Different call cases

The call is performed during the creation or modification of a purchase credit memo line.

Available variables and masks

The following variables are loaded when calling the "MAJRCPCDE" action.

WMAJRCPCDE

Specifies if the update of the order and the receipts must be performed. Enter the value for which the updates are not performed.

The following file classes are loaded: [F:PIH], [F:PIV] and [F:PID]

The [F:PIDB] class is loaded with the original invoice line.

The variables and the classes given above must not be modified.

Open tables

In the table below, the significant content flag indicates that the content matches the context.

Table

Significant content

Table Title

PINVOICE

Yes

Invoice header

PINVOICEV

Yes

Additional purchase invoice header

PINVOICED

Yes

Purchase invoice lines

Miscellaneous remarks

This entry point is only called in case of credit memo.

[M:PIH0]PIHTYP (1=invoice, 2=additional invoice, 3=credit note, 4=credit note on return)

CHGACCFCY: change of site to control analytical dimension types

This entry point is located in the SUBPIHA for saving purchase invoices. It is used to take control after clicking 'Create' or 'Save'.

The purpose is to give the possibility to change the site used to control the analytical dimension types of the invoice lines.

Context and operating mode

Transaction

There is no transaction in process.

Log file

There is no open log file.

Different call cases

The call is performed during the creation or modification of a purchase invoice.

Available variables and masks

The WFCY variable is loaded during the call. It includes the financial site of the invoice header site. This variable can be modified.

The following screen masks can be used: [M:PIH0], [M:PIH1], [M:PIH2], [M:PIH3], [M:PIH4]

The classes given above must not be modified.

Open tables

In the table below, the significant content flag indicates that the content is in phase with the context.

Table

Significant content

Table Title

PINVOICE

No

Invoice header

PINVOICEV

No

Additional purchase invoice header

PINVOICED

No

Purchase invoice lines