Hi Acebanner,
Thanks for your answer - I'll pour over it and see where it will help me.
Below are a pdf example of my invoice, and the invoice programming. The invoice program starts with the SalesOrder and then automatically manipulates a bunch of stuff in it to be able to present a printed invoice to the client, and an internal invoice for our records (which has some different and some additional information on it). After all the manipulation and printing, it then changes everything back to the SalesOrder form, and loops on to the next Sales Order to invoice. Having our invoicing process be automated is critical to us (we issue about 700 invoices a month), and the ability to move many of our clients from printed to emailed invoices would be a big benefit in time (no folding, enveloping time required) and money savings (no envelope expense, no stamp expense).
http://www.wordcom.com/28441.jpg The above link is an example of the invoice output from the programming below.
// prompt user for a list of order #s to invoice. Once the list is enters (separated by ";") // then that variable will be inserted into SONum field, the result set found, then the // screen will be setup by making some fields visible and others invisible, then the // result set will be looped through, printed, notated, then saved, then F10'd via code // to the next record in the result set. The last record will be saved via FormCommit, and a // summary report will be printed for the SONum, cust #, shipto ID, Orderer, PO#, Total cost, SOTotal, tax, pay this amount // Then a writeln window will display, telling user that the job is finished and how many records were printed
var vAnswer as string var vQuestion as string var vLoop as int var vCount as int var vIDate as string var vRS as int var n as int var vPrt as int var vInv as string var vQues2 as string var vSeparatePage as string var vMailDiff as string var vClientMailToAddress as string var vRSm as int var vClientID as string var vCountMail as int var vOrderShipToA as string var vOrderShipToB as string var vClientName as string var vClientAddress1 as string var vClientAddress2 as string var vClientCity as string var vClientState as string var vClientZip as string var vClientID4 as string var vRS4Tot as int var vRS4 as int var vClientBillingName as string var vSHOPC as double var vFlag2 as string var vSONum as string var vClientNameOri as string var vShipToOri as string
var vQtyNotPrinted as int var vQtyPrinted as int var vSONumsPrinted as string var vSONumsNotPrinted as string
var vSOCostTotal as double var vSOTotalShadow as double var vSOTaxTotal as double var vSOTaxTotalShadow as double var vSOTotalPlusTax as double
var vBatchCost as double var vBatchSales as double var vBatchSHOPC as double var vBatchTax as double var vBatchOverall as double
var vRSbo as int var vCountMailbo as int var vLoopbo as int var vSONumA as string var vSONumB as string var vSONumC as string var vSONumD as string var vSONumE as string var vSONumBO as string
var vSOLNum as string
var vRSSOLInv as int var vCountSOLInv as int var vLoopSOLInv as int var vSOLbo as string var vSOLInvDate as date
var vS as string
var vSavings as string var vSavingsInfo as string
var vInvoiceEmailAddress as string var vInvoice as string var vEmail as int
vQtyNotPrinted = 0 vSONumsNotPrinted = ""
vQtyPrinted = 0 vSONumsPrinted = ""
vBatchCost = 0 vBatchSales = 0 vBatchSHOPC = 0 vBatchTax = 0 vBatchOverall = 0
If @Group <> "clients" {
If @Mode() = 2 { vIDate = @Calendar("", "Invoice Date (Esc to cancel)") vIDate = @ToDate(vIDate)
If vIDate < @ToDate("04/01/2010") // = "" { @MsgBox("You must choose an invoice date to print invoices.","Please try again.","") } else if vIDate <> "" { vQuestion = @PromptforUserInput("Enter the order #s to be invoiced, separated by a semi-colon ';'","") vAnswer = vQuestion
If vAnswer = "" { @MsgBox("You must enter at least one valid Order # to invoice.", "Please", "try it again") }
else { FormFieldValue("", "SONum", 0, vAnswer) n = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)") vCount = @FormResultSetTotal("Orders")
If vCount = 0 { @MsgBox("No matching records.", "Review the Order #'s you inserted and try again", "") }
Else If vCount > 0 {
SubFormVisibility("LE0", 1) FormThrowfocus("SOLines", "Launchpad") VQues2 = @PromptForUserInput("Enter 'X' and press 'ok'","") FormFieldValue("SOLines", "Launchpad", 0, vQues2) NotifyForm(-1) FormCommit("SOLines") FormCommit("")
Attribute(WhosePage, ATTR_ID_FONT_SIZE, "28") CreateAProcess("RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n wcInvoic") Loiter(1500) For vLoop = 1 To vCount vInv = "" vSONum = @FormFieldValue("Orders", "SONum", vLoop) vInv = @FormFieldValue("Orders", "Invoiced", vLoop) If vInv <> "" { vSONumsNotPrinted = vSONumsNotPrinted + vSONum + ";" vQtyNotPrinted = vQtyNotPrinted + 1 }
else if vInv = "" { NotifyForm(-6) NotifyForm(-1) ResultSetCurrentPosition(vLoop)
vClientID = @FormFieldValue("", "ClientID", vLoop) vClientNameOri = @FormFieldValue("", "ClientName", vLoop) vShipToOri = @FormFieldValue("", "ShipTo", vLoop) SubFormVisibility("LE0", 1) Visibility(Savings, 0) FormResultSetCurrentPosition("SOLines", @FormResultSetTotal("SOLines")) vMailDiff = "" vClientMailToAddress = ""
Visibility(ClientID2, 0) Visibility(LE9, 0) Visibility(InternalFlag1, 0) Visibility(SOCostTotal, 0) Visibility(SOProfitTotal, 0) Visibility(LE2, 0) Visibility(LE3, 0) Visibility(LE4, 0) Visibility(LE20, 0) Visibility(SOTime, 0) Visibility(ClientEmail, 0) Visibility(SOTotal, 0) Visibility(SOTaxTotal, 0) Visibility(LE8, 0) Visibility(UserID, 0) Visibility(DateRange, 0) Visibility(DiscountPerc, 0)
Visibility(WhosePage, 1) Visibility(InvoiceDate, 1)
Visibility(SOTotalShadow, 1) Visibility(SOTaxTotalShadow, 1) Visibility(SOTotalPlusTax, 1) Visibility(SHOPC, 1) If DiscountPerc <> "" { Visibility(DiscountPerc, 1) } Visibility(LE12, 1) Visibility(Flag2, 0)
FormFieldValue("", "InvoiceDate", vLoop, vIDate) vSOCostTotal = SOCostTotal vSOTotalShadow = SOTotalShadow vSHOPC = SHOPC vSOTaxTotalShadow = SOTaxTotalShadow vSOTotalPlusTax = SOTotalPlusTax
If (SOTotalPlusTax > 0) or (SOTotalPlusTax = 0) { Attribute(LE1, ATTR_ID_LABEL, "MyCompany, Inc. - INVOICE") Attribute(LE6, ATTR_ID_LABEL, "P.O. Box 5555, Tulsa, OK 74159") Attribute(SONum, ATTR_ID_LABEL, "InvoiceNum") FormFieldValue("", "WhosePage", vLoop, "Client INVOICE") Visibility(Flag3, 1) FormFieldValue("", "Flag3", vLoop, "Please reference invoice # on payment document") vSavings = 0 vSavings = @TN(Savings) vSavingsInfo = 0 Visibility(Flag4, 0) If SOTotal > 0 { If (((@TN(vSavings) > 8) and (@TN(SOTotal) < 400)) or ((SOTotal > 400) and (@TN(vSavings))/(@TN(SOTotal)) > .03)) { vSavingsInfo = "You just saved over $" + vSavings + " by using MyCompany instead of a big box chain store!!" FormFieldValue("", "Flag4", vLoop, vSavingsInfo) Visibility(Flag4, 1) } } RGBColor(SONum, 0, 0, 255, 255, 165, 96) RGBColor(SOTotalPlusTax, -1, -1, -1, 255, 165, 96) RGBColor(WhosePage, -1, -1, -1, 255, 165, 96)
vBatchCost = vBatchCost + vSOCostTotal vBatchSales = vBatchSales + vSOTotalShadow vBatchSHOPC = vBatchSHOPC + vSHOPC vBatchTax = vBatchTax + vSOTaxTotalShadow vBatchOverall = vBatchOverall + vSOTotalPlusTax } else If SOTotalPlusTax < 0 { Attribute(LE1, ATTR_ID_LABEL, "MyCompany, Inc. - CREDIT") Attribute(LE6, ATTR_ID_LABEL, "P.O. Box 5555, Tulsa, OK 74159") Attribute(SONum, ATTR_ID_LABEL, "CreditNum") Attribute(InvoiceDate, ATTR_ID_LABEL, "CreditDate") Attribute(SOTotalPlusTax, ATTR_ID_LABEL, "Credit Amount") Attribute(SOTotalPlusTax, ATTR_ID_LABEL_RGB_COLOR, "255 0 0") FormFieldValue("", "WhosePage", vLoop, "Client CREDIT") Visibility(Flag3, 1) //FormFieldValue("", "Flag3", vLoop, "Please reference invoice # on payment document") RGBColor(SOTotalPlusTax, 255, 0, 0, 255, 255, 255) RGBColor(WhosePage, 255, 0, 0, 255, 255, 255)
vBatchCost = vBatchCost - vSOCostTotal vBatchSales = vBatchSales - vSOTotalShadow vBatchSHOPC = vBatchSHOPC - vSHOPC vBatchTax = vBatchTax - vSOTaxTotalShadow vBatchOverall = vBatchOverall - vSOTotalPlusTax } RGBColor(ClientName, 255, 0, 0, 255, 255, 255) RGBColor(ClientAddress1, 255, 0, 0, 255, 255, 255) RGBColor(ClientAddress2, 255, 0, 0, 255, 255, 255) RGBColor(ClientCity, 255, 0, 0, 255, 255, 255) RGBColor(ClientState, 255, 0, 0, 255, 255, 255) RGBColor(ClientZip, 255, 0, 0, 255, 255, 255) RGBColor(ClientPO, 255, 0, 0, 255, 255, 255) RGBColor(InvoiceDate, 0, 0, 255, 255, 255, 255)
vRSm = @XResultSetSearch(@FN, "Client", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!ClientID=" + vClientID) If vRSm > -1 { vCountMail = @XResultSetTotal(vRSm) If vCountMail = 1
{ vMailDiff = @XResultSetValue(vRSm, "ClientMailToDifferent") If vMailDiff = "Y" { vClientMailToAddress = @XResultSetValue(vRSm, "ClientMailToAddress")
If vClientMailToAddress <> "" { If ShipToID = "" { vOrderShipToA = "" vOrderShipToB = ""
VClientName = ClientName vClientAddress1 = ClientAddress1 vClientAddress2 = ClientAddress2 vClientCity = ClientCity vClientState = ClientState vClientZip = ClientZip vOrderShipToA = ShipTo
vOrderShipToB = vOrderShipToA + @NewLine() + vClientAddress1 + @NewLine() + vClientAddress2 + @NewLine() + vClientCity + ", " + vClientState + " " + vClientZip
ShipToName = vClientName ShipTo = vOrderShipToB vClientID4 = @Left(ClientID, 4) vRS4 = @XResultSetSearch(@FN, "Client", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!ClientID=" + vClientID4) If vRS4 > -1 { vRS4Tot = @XResultSetTotal(vRS4) If vRS4Tot = 1
{ vInvoiceEmailAddress = "" vClientBillingName = @XResultSetValue(vRS4, "ClientName") vInvoiceEmailAddress = @XResultSetValue(vRS4, "InvoiceEmailAddress") FormFieldValue("", "ClientName", vLoop, vClientBillingName) } } XResultSetClose(vRS4) }
Visibility(ClientAddress1, 0) Visibility(ClientAddress2, 0) Visibility(ClientCity, 0) Visibility(ClientState, 0) Visibility(ClientZip, 0) Visibility(MailToAddress, 1) FormFieldValue("", "MailToAddress", vLoop, vClientMailToAddress) } } } } XResultSetClose(vRSm)
FormViewType("SOLines", 1) Loiter(500) ForceRedraw() vS = @Right(SONum, 1) If vS <> "S" { If (vMailDiff = "") or ((vMailDiff <> "") and (vInvoiceEmailAddress = "")) { vPrt = @PrintAForm(0, 1, 1, 0, 28, -1, -1, -1, -1, 1, 1) } else if (vMailDiff <> "") and (vInvoiceEmailAddress <> "") { vPrt = @PrintAFormToHTML("./Invoices/" + vSONum + ".html") Loiter(500) If vPrt = 1 { vInvoice = "./Invoices/" + vSONum + ".html" vEmail = @sendmail("smtp2go.com","MyCompany Invoice","MyServer@gmail.com",vInvoiceEmailAddress,"","","Here is MyCompany invoice " + vSONum,"","",vInvoice) } else if vPrt = 0 { Writeln("error: Failed to create " + vSONum + ".html") }
}
} Attribute(LE1, ATTR_ID_LABEL, "MyCompany, Inc. Sales Order") Attribute(LE6, ATTR_ID_LABEL, "123 Main St., Tulsa, OK 74104") Attribute(SONum, ATTR_ID_LABEL, "SONum") Attribute(SOTotalPlusTax, ATTR_ID_LABEL, "Pay This Amount") Attribute(SOTotalPlusTax, ATTR_ID_LABEL_RGB_COLOR, "0 127 0") Attribute(InvoiceDate, ATTR_ID_LABEL, "InvoiceDate")
//Attribute(Flag3, ATTR_ID_LABEL, "Flag3")
Visibility(SOTotal, 1) Clear(Flag3) Visibility(Flag3, 0) Clear(Flag4) Visibility(Flag4, 0) RGBColor(ClientName, 0, 0, 0, 255, 255, 255) RGBColor(ClientAddress1, 0, 0, 0, 255, 255, 255) RGBColor(ClientAddress2, 0, 0, 0, 255, 255, 255) RGBColor(ClientCity, 0, 0, 0, 255, 255, 255) RGBColor(ClientState, 0, 0, 0, 255, 255, 255) RGBColor(ClientZip, 0, 0, 0, 255, 255, 255) RGBColor(ClientPO, 0, 0, 0, 255, 255, 255) RGBColor(SONum, 255, 0, 0, 255, 255, 255) RGBColor(WhosePage, 0, 0, 255, 229, 229, 229) RGBColor(SOTotalPlusTax, 0, 127, 0, 255, 255, 255) FormViewType("SOLines", 0) Loiter(100)
FormFieldValue("", "WhosePage", vLoop, "") vQtyPrinted = vQtyPrinted + 1 vSONumsPrinted = vSONumsPrinted + vSONum + ";"
If @Visibility(MailToAddress) = 1 { ClientName = vClientNameOri
Visibility(MailToAddress, 0) Visibility(ClientAddress1, 1) Visibility(ClientAddress2, 1) Visibility(ClientCity, 1) Visibility(ClientState, 1) Visibility(ClientZip, 1) ShipTo = vShipToOri } Visibility(Savings, 0) Visibility(Flag4, 0) NotifyForm(-1)
FormCommit("") } Next Attribute(WhosePage, ATTR_ID_FONT_SIZE, "18")
// this small section prints the Separator page btwn Client Invoices and WC Internal invoice copy
vSeparatePage = vCount + " invoices were attempted - " + vAnswer + "." + @NewLine() + "Actual qty printed was " + vQtyPrinted + ", and SONums printed were " + vSONumsPrinted + "." + @NewLine() + "Qty Not Printed were " + vQtyNotPrinted + ". SONums not printed were " + vSONumsNotPrinted NewPage(840, 1100) PrintString("Separator Page and Summary", 18, 18, 0, " ARIAL", 14, 0) PrintString(vSeparatePage, 21, @PageExtentY(), 400, " ARIAL", 14, 0)
PrintString("Total Sales = " + vBatchSales, 40, @PageExtentY(), 400, " ARIAL", 14, 0) PrintString("Total Freight = " + vBatchSHOPC, 40, @PageExtentY(), 400, " ARIAL", 14, 0) PrintString("Total Tax = " + vBatchTax, 40, @PageExtentY(), 400, " ARIAL", 14, 0) PrintString("Total Overall = " + vBatchoverall, 50, @PageExtentY(), 400, " ARIAL", 14, 0)
PrintString("Total Cost = " + vBatchCost, 60, @PageExtentY(), 400, " ARIAL", 14, 0)
FinishPage()
// this following code is the Internal Invoice copy
For vLoop = 1 To vCount vInv = ""
vSONum = @FormFieldValue("Orders", "SONum", vLoop) vInv = @FormFieldValue("Orders", "Invoiced", vLoop)
If vInv <> "" { writeln(vSONum + " not printed - previously invoiced") } else If vInv = "" {
NotifyForm(-1) NotifyForm(-6) ResultSetCurrentPosition(vLoop)
vClientID = @FormFieldValue("", "ClientID", vLoop) vClientNameOri = @FormFieldValue("", "ClientName", vLoop) vShipToOri = @FormFieldValue("", "ShipTo", vLoop)
SubFormVisibility("LE0", 1) FormResultSetCurrentPosition("SOLines", @FormResultSetTotal("SOLines")) vMailDiff = "" vClientMailToAddress = "" Visibility(ClientID2, 0) Visibility(LE9, 0) Visibility(InternalFlag1, 0) Visibility(Flag2, 0) Visibility(Flag3, 0) Visibility(Flag4, 0) Visibility(Savings, 0) Visibility(SOCostTotal, 0) Visibility(SOProfitTotal, 0) Visibility(LE2, 0) Visibility(LE3, 0) Visibility(LE4, 0) Visibility(LE20, 0) Visibility(SOTime, 0) Visibility(ClientEmail, 0) Visibility(SOTotal, 0) Visibility(SOTaxTotal, 0) Visibility(LE8, 0) Visibility(UserID, 0) Visibility(DateRange, 0) Visibility(WhosePage, 1) Visibility(InvoiceDate, 1)
Visibility(SOCostTotal, 1) Visibility(SOTotalShadow, 1) Visibility(SOTaxTotalShadow, 1) Visibility(SOTotalPlusTax, 1) Visibility(DiscountPerc, 1) Visibility(LE12, 1)
// this next little section finds backorders and assigns them an invoice and logout date so they show completed in searches
writeln(vSONum) vSONumA = vSONum + "A" vSONumB = vSONum + "B" vSONumC = vSONum + "C" vSONumD = vSONum + "D" vSONumE = vSONum + "E"
//vCountMailbo = 0 vRSbo = @XResultSetSearch(@FN, "Orders", SEARCH_MODE_OR, SEARCH_SYNTAX_QA, "!SONum=" + vSONumA, "!SONum=" + vSONumB, "!SONum=" + vSONumC, "!SONum=" + vSONumD, "!SONum=" + vSONumE)
If vRSbo > -1 { vCountMailbo = @XResultSetTotal(vRSbo)
If vCountMailbo > 0 { For vLoopbo = 1 to vCountMailbo
XResultSetCurrentPosition(vRSbo, vLoopbo) vSONumBO = @XResultSetValue(vRSbo, "SONum") XResultSetValue(vRSbo, "InvoiceDate", vIDate) XResultSetValue(vRSbo, "LogoutDate", @Date) XResultSetValue(vRSbo, "Invoiced", "B") Next } } XResultSetClose(vRSbo) vRSSOLInv = @XResultSetSearch(@FN, "Orders!SOLines", SEARCH_MODE_OR, SEARCH_SYNTAX_QA, "!SONum=" + vSONum, "!SONum=" + vSONumA, "!SONum=" + vSONumB, "!SONum=" + vSONumC, "!SONum=" + vSONumD, "!SONum=" + vSONumE) If vRSSOLInv > -1 { vCountSOLInv = @XResultSetTotal(vRSSOLInv)
If vCountSOLInv > 0 { For vLoopSOLInv = 1 to vCountSOLInv XResultSetCurrentPosition(vRSSOLInv, vLoopSOLInv) vSOLNum = @XResultSetValue(vRSSOLInv, "SONum") vSOLbo = @ContainsStringArray(vSOLNum, "A;B;C;D;E;X", 0) If vSOLbo <> "" { XResultSetValue(vRSSOLInv, "Invd", "B") XResultSetValue(vRSSOLInv, "InvoiceDate", vIDate) } Else If vSOLbo = "" { XResultSetValue(vRSSOLInv, "Invd", "Y") XResultSetValue(vRSSOLInv, "InvoiceDate", vIDate) }
Next } } XResultSetClose(vRSSOLInv)
// this ends the BO ticket updates section
FormFieldValue("", "InvoiceDate", vLoop, vIDate) FormFieldValue("", "LogoutDate", vLoop, @Date)
If (SOTotalPlusTax > 0) or (SOTotalPlusTax = 0) { Attribute(LE1, ATTR_ID_LABEL, "MyCompany, Inc. - invoice") Attribute(SONum, ATTR_ID_LABEL, "InvoiceNum") FormFieldValue("", "WhosePage", vLoop, "WC Internal Invoice") RGBColor(SONum, 0, 0, 255, 255, 165, 96) } else If SOTotalPlusTax < 0 { Attribute(LE1, ATTR_ID_LABEL, "MyCompany, Inc. - CREDIT") Attribute(SONum, ATTR_ID_LABEL, "CreditNum") Attribute(InvoiceDate, ATTR_ID_LABEL, "CreditDate") Attribute(SOTotalPlusTax, ATTR_ID_LABEL, "Credit Amount") Attribute(SOTotalPlusTax, ATTR_ID_LABEL_RGB_COLOR, "255 0 0") FormFieldValue("", "WhosePage", vLoop, "WC Internal Credit") RGBColor(SOTotalPlusTax, 255, 0, 0, 255, 255, 255) }
RGBColor(WhosePage, 255, 0, 0, 255, 255, 0) If (SHOPC <> "") and (SHOPC <> 0) { //vSHOPC = @FormFieldValue("Orders", "SHOPC", vLoop) //vSHOPC = @ToMoney(vSHOPC) //FormFieldValue("", "Flag2", vLoop, "Be Sure to Add SHOPC to AV32 invoice") Visibility(Flag2, 1) //vFlag2 = "x" // "Add SHOPC " + vSHOPC + " to AV32 invoice" //Loiter(25) //FormFieldValue("", "Flag2", vLoop, "Be Sure to Add SHOPC to AV32 invoice") }
RGBColor(ClientName, 255, 0, 0, 255, 255, 255) RGBColor(ClientAddress1, 255, 0, 0, 255, 255, 255) RGBColor(ClientAddress2, 255, 0, 0, 255, 255, 255) RGBColor(ClientCity, 255, 0, 0, 255, 255, 255) RGBColor(ClientState, 255, 0, 0, 255, 255, 255) RGBColor(ClientZip, 255, 0, 0, 255, 255, 255) RGBColor(ClientPO, 255, 0, 0, 255, 255, 255) RGBColor(SONum, 0, 0, 255, 255, 255, 255) RGBColor(InvoiceDate, 0, 0, 255, 255, 255, 255) RGBColor(SOCostTotal, 0, 0, 0, 252, 252, 168) RGBColor(SOTotalShadow, 0, 0, 0, 252, 252, 168) RGBColor(SHOPC, 0, 0, 0, 223, 229, 146)
vRSm = 0 vRSm = @XResultSetSearch(@FN, "Client", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!ClientID=" + vClientID) If vRSm > -1 { vCountMail = @XResultSetTotal(vRSm) If vCountMail = 1 { vMailDiff = @XResultSetValue(vRSm, "ClientMailToDifferent") If vMailDiff = "Y" { vClientMailToAddress = @XResultSetValue(vRSm, "ClientMailToAddress") If vClientMailToAddress <> "" { If ShipToID = "" {
vOrderShipToA = "" vOrderShipToB = ""
VClientName = ClientName vClientAddress1 = ClientAddress1 vClientAddress2 = ClientAddress2 vClientCity = ClientCity vClientState = ClientState vClientZip = ClientZip vOrderShipToA = ShipTo
vOrderShipToB = vOrderShipToA + @NewLine() + vClientAddress1 + @NewLine() + vClientAddress2 + @NewLine() + vClientCity + ", " + vClientState + " " + vClientZip
ShipToName = vClientName ShipTo = vOrderShipToB
vClientID4 = @Left(ClientID, 4) vRS4 = @XResultSetSearch(@FN, "Client", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!ClientID=" + vClientID4) If vRS4 > -1 { vRS4Tot = @XResultSetTotal(vRS4) If vRS4Tot = 1
{ vClientBillingName = @XResultSetValue(vRS4, "ClientName") FormFieldValue("", "ClientName", vLoop, vClientBillingName) } } XResultSetClose(vRS4) }
Visibility(ClientAddress1, 0) Visibility(ClientAddress2, 0) Visibility(ClientCity, 0) Visibility(ClientState, 0) Visibility(ClientZip, 0) Visibility(MailToAddress, 1) FormFieldValue("", "MailToAddress", vLoop, vClientMailToAddress) } } } } XResultSetClose(vRSm)
FormFieldValue("Orders", "Invoiced", vLoop, "Y") FormViewType("SOLines", 1) Loiter(500) If @Visibility(Flag2) = 1 { Flag2 = "Be sure to add SHOPC to AV32 invoice" } Loiter(200)
vS = @Right(SONum, 1) If vS <> "S" { vPrt = @PrintAForm(0, 1, 1, 0, 28, -1, -1, -1, -1, 1, 1) } Attribute(LE1, ATTR_ID_LABEL, "MyCompany Inc Sales Order") Attribute(SONum, ATTR_ID_LABEL, "SONum") Attribute(SOTotalPlusTax, ATTR_ID_LABEL_RGB_COLOR, "0 127 0")
Visibility(SOTotal, 1) Visibility(SOTaxTotal, 1) RGBColor(ClientName, 0, 0, 0, 255, 255, 255) RGBColor(ClientAddress1, 0, 0, 0, 255, 255, 255) RGBColor(ClientAddress2, 0, 0, 0, 255, 255, 255) RGBColor(ClientCity, 0, 0, 0, 255, 255, 255) RGBColor(ClientState, 0, 0, 0, 255, 255, 255) RGBColor(ClientZip, 0, 0, 0, 255, 255, 255) RGBColor(ClientPO, 0, 0, 0, 255, 255, 255) RGBColor(SONum, 255, 0, 0, 255, 255, 255) RGBColor(SOCostTotal, 0, 0, 0, 255, 255, 255) RGBColor(SOTotalShadow, 0, 0, 0, 255, 255, 255) RGBColor(SHOPC, 0, 0, 0, 255, 255, 255) RGBColor(SOTotalPlusTax, 0, 127, 0, 255, 255, 255)
FormViewType("SOLines", 0) Loiter(100) RGBColor(WhosePage, 0, 0, 255, 255, 255, 255) FormFieldValue("", "WhosePage", vLoop, "")
If @Visibility(MailToAddress) = 1 { ClientName = vClientNameOri
Visibility(MailToAddress, 0) Visibility(ClientAddress1, 1) Visibility(ClientAddress2, 1) Visibility(ClientCity, 1) Visibility(ClientState, 1) Visibility(ClientZip, 1) ShipTo = vShipToOri } Clear(Flag2) Visibility(Flag2, 0) Visibility(DateRange, 1)
NotifyForm(-1) FormCommit("") } Next
//Writeln((vCount) + " records were invoiced. The Order/Invoice #s were " + vAnswer) CreateAProcess("RUNDLL32 PRINTUI.DLL,PrintUIEntry /y /n wcLaser1")
}
}
} }
}
|