Page 1 of 1

oSlsHistory.DocketPrinted gives wrong information ??

PostPosted: Tue Jun 28, 2016 11:04 pm
by indikad
unsure if this is a bug
I am checking if a delivery docket was printed for the current snapshot on so line change (my current snapshot history number is 2) and my code returns true even when the current snapshot was not printed ( only the previous snapshot was printed and I am not sure if its getting confused with the previous print ).
also I have processed the order ( partial delivery for snaphot 1 ) and created snapshot 2 for another delivery.

if I checked the so_printLog i can see the delivery docket was printed only once and that was for the history number 1

code below

Code: Select all
AddHandler SalesOrdForm.SalesOrder.SalesOrderLineChanged  , AddressOf SalesOrderLineChanged

Sub SalesOrderLineChanged (ByVal sender As Object ,ByVal Item As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine ,e As System.ComponentModel.PropertyChangedEventArgs  )
      msgbox ( " sales order line changed valie of e.PropertyName  = " + e.PropertyName.ToString())
      Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast( sender , JiwaSales.SalesOrder.SalesOrder)
               
      Dim bPrinted As Boolean = False
      Dim oSlsHistory As JiwaSales.SalesOrder.SalesOrderHistory
      oSlsHistory =  salesOrder.SalesOrderHistorys(salesOrder.CurrentHistoryNo)
      msgbox ( " curr history = " + salesOrder.CurrentHistoryNo.ToString() )
      '-----------------------------------
       'check if printed Delivery docket
       '-----------------------------------    
      oSlsHistory.invoice
      If oSlsHistory.DocketPrinted Then      
         MsgBox( "Delivery Docket. has been printed. ",vbOKOnly , "Jiwa")
         
      End If


oSlsHistory.DocketPrinted

Re: oSlsHistory.DocketPrinted gives wrong information ??  Topic is solved

PostPosted: Wed Jun 29, 2016 10:23 am
by Mike.Sheen
indikad wrote:unsure if this is a bug


It's a bug. I've logged it as Bug #12831.

To work around this in your code, don't look at the DocketPrinted flag on the history class, just iterate through the printlog to work out if it was printed.

Re: oSlsHistory.DocketPrinted gives wrong information ??

PostPosted: Wed Jun 29, 2016 10:36 am
by indikad
Thanks Mike - i have resorted to checking the print log table.