Helllo,

I have to adjust current printing script. So that, based on country --> a different Invoice layout gets selected by the print invoice script.

This to meet EU vat regulations... Different informations has to be present for costumes/tax authorities = different layouts

my Idea:

Based on companies country input in the records I can have the script make an IF script...

Example:
1. if Companies::Country = "The Netherlands"
= Layout 1

2.if Companies::Country = "Belgium or France or Germany... Or (inside EU) "
= Layout 2

3.if Companies::Country = "other country OR lists"
= Layout 3

4. If... Not recognized = Please adjust country name error message


Please see the current Print Script.. below.

Could someone help me to get the proper if script adjustment.

Thanks in advanceIf [ Get(WindowMode)=0 ]
Perform Script [ “Confirm Privileges”; Parameter: "Invoices 1" ]
Set Error Capture [ On ]
Perform Script [ “Decide User Abort” ]
Commit Records/Requests
If [ Invs::Void = 1 ]
Show Custom Dialog [ Title: "Print Error"; Message: "Invoice " & Invs::Invoice_ID & " has been Voided. Nothing to print.";
Buttons: “OK” ]
Else If [ ILs::kOne ≠ 1 ]
Sort Records [ Specified Sort Order: Invs::Invoice_ID; ascending ]
[ Restore; No dialog ]
Go to Layout [ “Invoice Print (Non Merch)” (Invs) ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Perform Script [ “Window Control Preview” ]
Print [ Current record; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore ]
Enter Browse Mode
Go to Layout [ original layout ]
Perform Script [ “Window Control Browse” ]
Else
If [ Get ( ScriptParameter ) = 2 ]
Show Custom Dialog [ Message: "Really Print all the found Invoices?"; Buttons: “OK”, “Cancel” ]
If [ Get( LastMessageChoice) = 1 ]
Sort Records [ Specified Sort Order: Invs::Invoice_ID; ascending ]
[ Restore; No dialog ]
Go to Record/Request/Page
[ First ]
Loop
If [ ILs::kOne ≠ 1 ]
Go to Layout [ “Invoice Print (Non Merch)” (Invs) ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Print [ Current record; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Enter Browse Mode
Else
Go to Related Record [ From table: “ILs”; Using layout: “Invoice Print” (ILs) ]
[ Show only related records ]
If [ Invs::vPrintSKU ]
Go to Layout [ “Invoice Print (SKU)” (ILs) ]
End If
If [ Get ( ScriptParameter ) = "Consolidated" ]
Go to Layout [ “Invoice Print (Consol)” (ILs) ]
End If
Perform Script [ “Sort IL Attrib” ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
End If
Go to Layout [ “Invoices 1” (Invs) ]
Enter Browse Mode
If [ Stds::vPrint_BackOrder_Invoice = 1 and
Orders::Qty_Open > 0 ]
Go to Related Record [ From table: “Orders”; Using layout: “Orders 1 Old” (Orders) ]
[ Show only related records ]
Go to Related Record [ From table: “OIs”; Using layout: “OIs 1” (OIs) ]
[ Show only related records ]
Perform Script [ “Order Print Back Order”; Parameter: "silent" ]
End If
Go to Layout [ “Invoices 1” (Invs) ]
Enter Browse Mode
Go to Record/Request/Page
[ Next; Exit after last ]
End Loop
Perform Script [ “Window Control Browse” ]
End If
Else
Go to Related Record [ From table: “ILs”; Using layout: “Invoice Print” (ILs) ]
[ Show only related records ]
If [ Invs::vPrintSKU ]
Go to Layout [ “Invoice Print (SKU)” (ILs) ]
End If
If [ Get ( ScriptParameter ) = "Consolidated" ]
Go to Layout [ “Invoice Print (Consol)” (ILs) ]
End If
Perform Script [ “Sort IL Attrib” ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Perform Script [ “Window Control Preview” ]
Print [ Records being browsed; All Pages; Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore ]
Go to Layout [ original layout ]
Enter Browse Mode
If [ Stds::vPrint_BackOrder_Invoice = 1 and
Orders::Qty_Open > 0 ]
Go to Related Record [ From table: “Orders”; Using layout: “Orders 1 Old” (Orders) ]
[ Show only related records ]
Go to Related Record [ From table: “OIs”; Using layout: “OIs 1” (OIs) ]
[ Show only related records ]
Perform Script [ “Order Print Back Order” ]
Go to Layout [ “Invoices 1” (Invs) ]
End If
Perform Script [ “Window Control Browse” ]
End If
End If
End If
Warning: This is an Old Thread
This discussion is older than 420 days. information contained in it may no longer be current