AnsweredAssumed Answered

extra lines appearing in portal line items

Question asked by willrollo on Oct 4, 2013
Latest reply on Oct 8, 2013 by willrollo

Title

extra lines appearing in portal line items

Post

     I have created a script that is designed to credit an invoice. It does work (although a messy script) but for some reason there are two extra blank lines in the line items portal of the 'credit note'/ One above and one below the actual line item to be credited. There is only one line item to be credited on any single invoice.

     Here is the script

      

         
  •           Freeze Window
  •      
  •           Set Variable [ $ID; Value:INVOICE DETAILS::ID_Invoice_pk ]
  •      
  •           Enter Find Mode [ Specified Find Requests: Find Records; Criteria: INVOICE DETAILS::fk_Invoice: “>1” Omit Records; Criteria: INVOICE DETAILS::Visible Invoice: “1” ] [ Restore ]
  •      
  •           Set Field [ INVOICE DETAILS::ID_Invoice_pk; $ID ]
  •      
  •           Perform Find [ ]
  •      
  •           #Duplicate Invoice Record
  •      
  •           Set Variable [ $InvNumOrg; Value:INVOICE DETAILS::ID_Invoice_pk ]
  •      
  •           Set Variable [ $InvoiceID; Value:INVOICE DETAILS::fk_Invoice ]
  •      
  •           Set Variable [ $TaxPercentage; Value:INVOICE DETAILS::Tax_Percentage ]
  •      
  •           Set Variable [ $Reference; Value:INVOICE DETAILS::Reference ]
  •      
  •           Go to Related Record [ From table: “invoicedetails_INVOICEITEM”; Using layout: “INVOICE ITEMS” (INVOICEITEMS) ] [ Show only related records ]
  •      
  •           Go to Layout [ “Credit Note” (INVOICE DETAILS) ]
  •      
  •           Duplicate Record/Request
  •      
  •           Set Field [ CREDIT::fk_Invoice details ID; INVOICE DETAILS::ID_Invoice_pk ]
  •      
  •           Perform Script [ “Copy Shipping to Shipping” ]
  •      
  •           Set Variable [ $InvNumNew; Value:INVOICE DETAILS::ID_Invoice_pk ]
  •      
  •           Set Field [ INVOICE DETAILS::fk_Credit; CREDIT::Credit Number ]
  •      
  •           Set Field [ INVOICE DETAILS::fk_Credit date; CREDIT::Credit Date ]
  •      
  •           Set Field [ INVOICE DETAILS::Tax_Percentage; $TaxPercentage ]
  •      
  •           Set Field [ INVOICE DETAILS::Prev Invoice; $InvoiceID ]
  •      
  •           Set Field [ INVOICE DETAILS::Type; "Credit" ]
  •      
  •           Set Field [ Invoices::fk_Invoice details ID; INVOICE DETAILS::ID_Invoice_pk ]
  •      
  •           Set Field [ INVOICE DETAILS::fk_Invoice; Invoices::Invoice Number ]
  •      
  •           Set Field [ INVOICE DETAILS::fk_Invoice Date; Invoices::Invoice Date ]
  •      
  •           #Duplicate Invoice Line Items
  •      
  •           Go to Layout [ “INVOICE ITEMS” (INVOICEITEMS) ]
  •      
  •           Go to Record/Request/Page [ First ]
  •      
  •           Set Variable [ $Item; Value:INVOICEITEMS::Item ]
  •      
  •           Set Variable [ $Description; Value:INVOICEITEMS::Description ]
  •      
  •           Set Variable [ $Quantity; Value:INVOICEITEMS::Quantity ]
  •      
  •           Set Variable [ $PriceUnit; Value:INVOICEITEMS::Price ]
  •      
  •           Set Variable [ $Taxable; Value:INVOICEITEMS::Discountable ]
  •      
  •           New Record/Request
  •      
  •           Set Field [ INVOICEITEMS::ID_Invoice_fk; $ID ]
  •      
  •           Set Field [ INVOICEITEMS::Date; $Date ]
  •      
  •           Set Field [ INVOICEITEMS::Item; $Item ]
  •      
  •           Set Field [ INVOICEITEMS::Description; $Description ]
  •      
  •           Set Field [ INVOICEITEMS::Quantity; $Quantity ]
  •      
  •           Set Field [ INVOICEITEMS::Price; $PriceUnit *-1 ]
  •      
  •           Set Field [ INVOICEITEMS::Discountable; $Taxable ]
  •      
  •           Go to Layout [ “Credit Note” (INVOICE DETAILS) ]
  •      
  •           Show Custom Dialog [ Title: "Message"; Message: "Invoice Credited!"; Default Button: “OK”, Commit: “Yes” ]

Outcomes