def _create_receiving_order(self): # since we will create a new receiving order, we should confirm the # purchase first. Note that the purchase may already be confirmed if self.model.status in [ PurchaseOrder.ORDER_PENDING, PurchaseOrder.ORDER_CONSIGNED ]: self.model.confirm(api.get_current_user(self.store)) temporary_identifier = None if self.wizard.is_for_another_branch(): temporary_identifier = ReceivingOrder.get_temporary_identifier( self.store) receiving_invoice = ReceivingInvoice( store=self.store, supplier=self.model.supplier, branch=self.model.branch, station=api.get_current_station(self.store), responsible=api.get_current_user(self.store)) receiving_model = ReceivingOrder( identifier=temporary_identifier, receiving_invoice=receiving_invoice, responsible=receiving_invoice.responsible, branch=self.model.branch, station=api.get_current_station(self.store), invoice_number=None, store=self.store) receiving_model.add_purchase(self.model) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def _create_receiving_order(self): # since we will create a new receiving order, we should confirm the # purchase first. Note that the purchase may already be confirmed if self.model.status in [PurchaseOrder.ORDER_PENDING, PurchaseOrder.ORDER_CONSIGNED]: self.model.confirm() temporary_identifier = None if self.wizard.is_for_another_branch(): temporary_identifier = ReceivingOrder.get_temporary_identifier(self.store) receiving_invoice = ReceivingInvoice( store=self.store, supplier=self.model.supplier, branch=self.model.branch, responsible=api.get_current_user(self.store)) receiving_model = ReceivingOrder( identifier=temporary_identifier, receiving_invoice=receiving_invoice, responsible=receiving_invoice.responsible, branch=self.model.branch, invoice_number=None, store=self.store) receiving_model.add_purchase(self.model) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def create_receiving_order(self, station): notes = u"Created automatically with Stoq-Link" # TODO Eventually get this from the invoice data. cfop = sysparam.get_object(self.store, 'DEFAULT_RECEIVING_CFOP') receiving_invoice = ReceivingInvoice( store=self.store, freight_total=self.freight_cost, invoice_number=self.invoice_number, invoice_total=self.total_cost, supplier=self.purchase_order.supplier, branch=self.branch, responsible=self.user, station=station) receiving_order = ReceivingOrder(store=self.store, branch=self.branch, station=station, notes=notes, cfop=cfop, confirm_date=datetime.datetime.now(), status=u'closed', receiving_invoice=receiving_invoice) receiving_order.add_purchase(self.purchase_order) for item in self.purchase_order.get_items(): receiving_order.add_purchase_item(item=item) if self.freight_type == PurchaseOrder.FREIGHT_CIF: receiving_order.update_payments(create_freight_payment=True) receiving_invoice.freight_type = receiving_invoice.guess_freight_type() receiving_order.confirm(self.user) return receiving_order
def create_receiving_order(self): from stoqlib.domain.receiving import ReceivingOrder receiving = ReceivingOrder(self.store, branch=self.branch) receiving.add_purchase(self) for item in self.get_items(): receiving.add_purchase_item(item, quantity=item.quantity) return receiving
def create_receiving_order(self, station: BranchStation): from stoqlib.domain.receiving import ReceivingOrder receiving = ReceivingOrder(self.store, branch=self.branch, station=station) receiving.add_purchase(self) for item in self.get_items(): receiving.add_purchase_item(item, quantity=item.quantity, ipi_value=item.ipi_value) return receiving
def create_receiving_order(self): from stoqlib.domain.receiving import ReceivingOrder receiving = ReceivingOrder(self.store, branch=self.branch) receiving.add_purchase(self) for item in self.get_items(): receiving.add_purchase_item(item, quantity=item.quantity, ipi_value=item.ipi_value) return receiving
def _create_receiving_order(self): self.model.set_consigned() receiving_model = ReceivingOrder( responsible=api.get_current_user(self.store), purchase=self.model, supplier=self.model.supplier, branch=self.model.branch, transporter=self.model.transporter, invoice_number=None, store=self.store) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def _create_receiving_order(self): self.model.set_consigned() receiving_model = ReceivingOrder( responsible=api.get_current_user(self.store), supplier=self.model.supplier, branch=self.model.branch, transporter=self.model.transporter, invoice_number=None, store=self.store) receiving_model.add_purchase(self.model) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def _create_receiving_order(self): # since we will create a new receiving order, we should confirm the # purchase first. self.model.confirm() receiving_model = ReceivingOrder( responsible=api.get_current_user(self.store), purchase=self.model, supplier=self.model.supplier, branch=self.model.branch, transporter=self.model.transporter, invoice_number=None, store=self.store) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def _create_receiving_order(self): # since we will create a new receiving order, we should confirm the # purchase first. self.model.confirm() receiving_model = ReceivingOrder(responsible=api.get_current_user( self.store), purchase=self.model, supplier=self.model.supplier, branch=self.model.branch, transporter=self.model.transporter, invoice_number=None, store=self.store) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model
def _create_receiving_order(self): # since we will create a new receiving order, we should confirm the # purchase first. Note that the purchase may already be confirmed if self.model.status in [PurchaseOrder.ORDER_PENDING, PurchaseOrder.ORDER_CONSIGNED]: self.model.confirm() receiving_model = ReceivingOrder( responsible=api.get_current_user(self.store), supplier=self.model.supplier, branch=self.model.branch, transporter=self.model.transporter, invoice_number=None, store=self.store) receiving_model.add_purchase(self.model) # Creates ReceivingOrderItem's for item in self.model.get_pending_items(): receiving_model.add_purchase_item(item) self.wizard.receiving_model = receiving_model