indikad wrote:The credit note I am creating is not based on a sale quotation - its rather based on a sale order. Therefore I do not have a QuoteHistoryID to supply to the
QuoteHistoryID parameter.
Indeed. I don't know why I assumed it was coming from a quote!
indikad wrote:However my code line worked ( as far as bringing the order lines to the credit note) when I tested on V7.0.175
BUT- does not work on 7.2 ( it only creates the header ) Is this a bug in 7.2 ?
Hard to say but there must be a way to work around it if it is a bug, as the sales order form in Jiwa is able to create credit notes based on a sales order and it simply uses the business logic as you are. This is the exact line of code used by the sales order form to create a credit note from a known sales order history ID:
- Code: Select all
_SalesOrder.CreateNew(JiwaSales.SalesOrder.SalesOrder.NewSalesOrderTypes.e_NewSalesOrderCreditNote, "", True, SourceHistoryID)
I've had a look at the code inside CreateNew and the only thing I can see which would cause the behaviour you are seeing is if the SourceHistoryID was blank or invalid. Check for leading or trailing spaces as well.
indikad wrote:one side question : what does the last parameter do in this case ( the LogicalWarehouseID ). Could I potentially use this to create the credit and all its lines on a different warehouse to the base order ? Therefore not having to use the lagacy way of specifying the Logical ID in linedetail ?
Yes, that would work also if each line is going into the same warehouse. That parameter was originally used by the Service Manager module to override the warehouse used for invoices or credits created from service jobs.