'use strict';
var BaseModel = require('model-toolkit').BaseModel;
var ProductionOrder=require('./production-order');
var Buyer = require('../master/buyer');
var Product = require('../master/product');
var OrderType = require('../master/order-type');
var ProcessType = require('../master/process-type');
var uom = require('../master/uom');
var AccountBank = require('../master/account-bank');
var MaterialConstruction=require('../master/material-construction');
var SalesContractDetail=require('./finishing-printing-sales-contract-detail');
var Comodity = require('../master/comodity');
var Quality = require('../master/quality');
var YarnMaterial= require('../master/yarn-material');
var TermOfPayment= require('../master/term-of-payment');


module.exports = class FinishingPrintingSalesContract extends BaseModel {
    constructor(source) {
        super('finishing-printing-sales-contract', '1.0.0');

        this.salesContractNo='';

        this.buyerId={};
        this.buyer= new Buyer();

        this.dispositionNumber='';

        this.processTypeId={};
        this.processType=new ProcessType();

        this.orderTypeId={};
        this.orderType=new OrderType();

        this.materialId={};
        this.material=new Product();

        this.uomId={};
        this.uom=new uom();

        this.materialConstructionId={};
        this.materialConstruction=new MaterialConstruction();
        
        this.yarnMaterialId={};
        this.yarnMaterial=new YarnMaterial();

        this.materialWidth='';
        this.orderQuantity=0;
        this.shippingQuantityTolerance=0;
        this.amount=0;

        this.comodityId={};
        this.comodity=new Comodity();

        this.comodityDescription='';

        this.qualityId={};
        this.quality=new Quality();

        this.useIncomeTax = false;

        this.termOfPaymentId = {};
        this.termOfPayment=new TermOfPayment();

        this.accountBankId={};
        this.accountBank=new AccountBank();

        this.transportFee='';
        this.deliveredTo='';
        this.packing='';
        this.termOfShipment="";

        this.agentId={};
        this.agent=new Buyer();

        this.comission='';
        this.deliverySchedule=new Date();
        this.condition='';
        this.remark='';

        this.details=[];
        this.details = (this.details || []).map(detail => new SalesContractDetail(detail));

        this.copy(source);
    }
};
@@ -247,26 +247,27 @@
 ');%0Avar 
-ProcessTyp
+DesignMotiv
 e = requ
@@ -285,19 +285,20 @@
 ter/
-process-typ
+design-motiv
 e');
@@ -1042,26 +1042,27 @@
    this.
-processTyp
+designMotiv
 eId=%7B%7D;%0A
@@ -1078,34 +1078,36 @@
 his.
-processType=new ProcessTyp
+designMotive=new DesignMotiv
 e();
@@ -1611,16 +1611,45 @@
 mount=0;
+%0A        this.pieceLength='';
 %0A%0A      
@@ -2247,24 +2247,24 @@
 new Date();%0A
+
         this
@@ -2281,32 +2281,8 @@
 ='';
-%0A        this.remark='';
 %0A%0A  

fix Finishing printing SC