private RequisitionOrder fillOrderHead(OrderHead orderHead)
    {
        RequisitionOrder order = new RequisitionOrder();

        com.Sconit.Entity.Svp.User createUser = new com.Sconit.Entity.Svp.User();
        createUser.name = orderHead.CreateUser.Name;

        com.Sconit.Entity.Svp.User planner = new com.Sconit.Entity.Svp.User();
        planner.name = orderHead.CreateUser.Name;

        com.Sconit.Entity.Svp.Party partyFrom = new com.Sconit.Entity.Svp.Party();
        partyFrom.id = orderHead.PartyFrom.Code;
        partyFrom.code = orderHead.PartyFrom.Code;
        partyFrom.description = orderHead.PartyFrom.Name;

        if (orderHead.ShipFrom != null)
        {
            partyFrom.address = orderHead.ShipFrom.Address;
            partyFrom.contact = orderHead.ShipFrom.ContactPersonName;
            partyFrom.telephone = orderHead.ShipFrom.TelephoneNumber;
            partyFrom.mobilephone = orderHead.ShipFrom.MobilePhone;
            partyFrom.fax = orderHead.ShipFrom.Fax;
            partyFrom.postCode = orderHead.ShipFrom.PostalCode;
        }

        com.Sconit.Entity.Svp.Party partyTo = new com.Sconit.Entity.Svp.Party();
        partyTo.id = orderHead.PartyTo.Code;
        partyTo.code = orderHead.PartyTo.Code;
        partyTo.description = orderHead.PartyTo.Name;

        if (orderHead.ShipTo != null)
        {
            partyTo.address = orderHead.ShipTo.Address;
            partyTo.contact = orderHead.ShipTo.ContactPersonName;
            partyTo.telephone = orderHead.ShipTo.TelephoneNumber;
            partyTo.mobilephone = orderHead.ShipTo.MobilePhone;
            partyTo.fax = orderHead.ShipTo.Fax;
            partyTo.postCode = orderHead.ShipTo.PostalCode;
        }

        order.id = orderHead.OrderNo;
        order.requisitionOrderNo = orderHead.OrderNo;
        order.type = orderHead.Type;
        order.orderType = orderHead.SubType;
        order.priority = orderHead.Priority;
        order.createUser = createUser;
        order.createDate = orderHead.CreateDate;
        order.createDateSpecified = true;
        order.effectiveDate = orderHead.StartTime;
        order.effectiveDateSpecified = true;
        order.demandDeliverDate = orderHead.WindowTime;
        order.demandDeliverDateSpecified = true;

        string t = (orderHead.DockDescription == null || orderHead.DockDescription == string.Empty) ?
            orderHead.PartyTo.Code : orderHead.PartyTo.Code + "@" + orderHead.DockDescription;

        order.demandDeliverAddr = orderHead.PartyTo.Name + " " + t + " "
            + (orderHead.DockDescription != null ? orderHead.DockDescription : string.Empty);

        order.partyFrom = partyFrom;
        order.partyTo = partyTo;
        if (orderHead.Status == BusinessConstants.CODE_MASTER_STATUS_VALUE_INPROCESS)
        {
            order.status = "In_Process";
        }else{
        order.status = orderHead.Status;
        }
        order.planner = planner;

        order.print = orderHead.IsPrinted;
        order.printSpecified = true;

        return order;
    }
Example #2
0
    private BillingItem fillBillDetail(BillDetail billDetail)
    {
        com.Sconit.Entity.Svp.BillingItem item = new com.Sconit.Entity.Svp.BillingItem();

        item.memo = string.Empty;
        item.billingQuantity =Convert.ToDouble(billDetail.BilledQty);
        item.unitPrice = billDetail.UnitPrice;
        item.unitPriceSpecified = true;

           UOM u = new UOM();
        u.abbreviation = billDetail.ActingBill.Uom.Code;
        u.description = billDetail.ActingBill.Uom.Description;

        Material m = new Material();
        m.quantityUOM = u;
        m.id = billDetail.ActingBill.Item.Code;
        m.no = billDetail.ActingBill.Item.Code;
        m.name = billDetail.ActingBill.Item.Description;
        m.description = billDetail.ActingBill.Item.Description;

        RequisitionOrder requisitionOrder = new RequisitionOrder();
        requisitionOrder.requisitionOrderNo = billDetail.ActingBill.OrderNo;

        DeliveryOrder deliveryOrder = new DeliveryOrder();
        deliveryOrder.requisitionOrder = requisitionOrder;

        ReceivingNote receiveNote = new ReceivingNote();
        receiveNote.id = billDetail.ActingBill.ReceiptNo;
        receiveNote.receivingNo = billDetail.ActingBill.ReceiptNo;
        receiveNote.deliveryOrder = deliveryOrder;

        ReceivingNoteItem receiveItem = new ReceivingNoteItem();
        receiveItem.material = m;
        receiveItem.receiveQuantity = Convert.ToDouble(billDetail.BilledQty);
        receiveItem.receiveQuantitySpecified = true;
        receiveItem.totalBillingQuantity = Convert.ToDouble( billDetail.BilledQty);
        receiveItem.totalBillingQuantitySpecified = true;
        receiveItem.receivingNote = receiveNote;

        item.material = m;
        item.receivingNoteItem = receiveItem;

        return item;
    }