You are correct.  Read these and try again.  :)

http://java.sun.com/docs/books/tutorial/java/javaOO/methods.html
http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html

C

> Date: Thu, 26 Jun 2008 18:40:09 -0400
> From: [EMAIL PROTECTED]
> To: user@ofbiz.apache.org
> Subject: Re: POS - receipt template question
> 
> Yah I just saw that....Took me a while to understand the whole boolean
> thing!
> 
> Thanks!
> 
> I changed it a bit...(don't laugh at this)
> 
> I set a "call?" in save sale (my save and print button) do simply do this:
> DeviceLoader.receipt.printPrep(m_trans);
> 
> I imported the right things, and this did work when it was "printReceipt".
> It would just bark becuase it didn't have a barcode to print yet..but it
> still printed.
> 
> Then in Receipt.java I have this:
> protected String[] prepReceiptTmpl = null;
> 
>  public void printPrep(PosTransaction trans) {
>         Debug.log("Print Receipt Requested : " + trans.getTransactionId(),
> module);
>         POSPrinter printer = (POSPrinter) control;
>         this.lastTransaction = trans;
> ===========AND=============
>         try {
>             if (!checkState(printer)) {
>                 return;
>             }
>         } catch (JposException e) {
>             Debug.logError(e, module);
>         }
> 
>         String[] prepReceipt = this.readPrepTemplate();
>         //this.printPrep(trans, prepReceipt, 0, null);
>         this.printPrep(trans, prepReceipt, 3, null);
>     }
> ==================AND===========
>  private synchronized String[] readPrepTemplate() {
>         if (this.prepReceiptTmpl == null) {
>             this.prepReceiptTmpl = new String[7];
>             this.readTemplate(prepReceiptTmpl, "prepreceipt.txt", 3);
>         }
> 
>         return this.prepReceiptTmpl;
>     }
> 
> and I get this error at compile:
> 
> [javac]
> /ofbiz/ofbizmamas/specialpurpose/pos/src/org/ofbiz/pos/device/impl/Receipt.java:198:
> printPrep(org.ofbiz.pos.PosTransaction) in org.ofbiz.pos.device.impl.Receipt
> cannot be applied to
> (org.ofbiz.pos.PosTransaction,java.lang.String[],int,<nulltype>)
>     [javac]         this.printPrep(trans, prepReceipt, 3, null);
> 
> 
> I know it's syntax and my inability to know what to pass and where....but
> any help would be fantastic.
> 
> Thanks... I know your busy, so I'll wait patiently!
> 
> Ta-Ta!
> On Thu, Jun 26, 2008 at 6:26 PM, Christopher L <[EMAIL PROTECTED]>
> wrote:
> 
> > It's passed in the method parameters.
> > public void printReceipt(PosTransaction trans, boolean printStoreCopy)
> >
> > C
> > > Date: Thu, 26 Jun 2008 17:47:56 -0400
> > > From: [EMAIL PROTECTED]
> > > To: user@ofbiz.apache.org
> > > Subject: POS - receipt template question
> > >
> > > All,
> > >
> > > How in the devil does Receipt.java know whether or not to print a store
> > copy
> > > as well, or just the customer copy.
> > >
> > > I see this:
> > >
> > >     public void printReceipt(PosTransaction trans, boolean
> > printStoreCopy) {
> > >         Debug.log("Print Receipt Requested : " +
> > trans.getTransactionId(),
> > > module);
> > >         POSPrinter printer = (POSPrinter) control;
> > >         this.lastTransaction = trans;
> > >
> > >         try {
> > >             if (!checkState(printer)) {
> > >                 return;
> > >             }
> > >         } catch (JposException e) {
> > >             Debug.logError(e, module);
> > >         }
> > >
> > >         if (printStoreCopy) {
> > >             String[] storeReceipt = this.readStoreTemplate();
> > >             int payments = trans.getNumberOfPayments();
> > >             for (int i = 0; i < payments; i++) {
> > >                 Map info = trans.getPaymentInfo(i);
> > >                 if (info.containsKey("cardNumber")) {
> > >                     this.printReceipt(trans, storeReceipt, 1, info);
> > >                 }
> > >                 try {
> > >                     Thread.sleep(3000);
> > >                 } catch (Exception e) {
> > >                 }
> > >             }
> > >         }
> > >
> > >         // print the customer receipt
> > >         String[] custReceipt = this.readCustomerTemplate();
> > >         this.printReceipt(trans, custReceipt, 0, null);
> > >     }
> > >
> > > so if (printStoreCopy) is the keystone here... I can see that... but
> > where
> > > in the H is it passed?!?!?!
> > >
> > > I'd like to have one more template to include the additional info field.
> > > It's called prepreceipt.txt.  For now, It'll go to the same printer...
> > I'm
> > > hoping somehow to use the method above, or a close version of it to print
> > to
> > > the same printer, but using the other template.
> > >
> > > and..... I'm at a loss!
> > >
> > > Thanks!
> >

Reply via email to