Check-in [38e7fee3d6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed defect [62368fca39]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:38e7fee3d695ce718267b193f010b31bf0342219
User & Date: xiekevin 2017-12-31 04:06:31
Context
2018-01-02
16:55
Solution to feature request [67c4ba4175] check-in: 9ddfbbd676 user: xiekevin tags: trunk
2017-12-31
04:06
Fixed defect [62368fca39] check-in: 38e7fee3d6 user: xiekevin tags: trunk
03:47
fix defect [fb88c8b484] check-in: 65f8893110 user: xiekevin tags: trunk
Changes

Changes to src/fanxi/middle/Actor.java.

1370
1371
1372
1373
1374
1375
1376





1377
1378
1379
1380
1381




1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
			JsonObject	jsonSale;
			try {
				ctx.mConn=this.mEngine.mRepo.getConnection();
				Connection conn = ctx.mConn;
				if( sale.id()==null ) {
					// this is a unsaved sale, all data are in the JSON already
					jsonSale = jsonReqSale;





				}else{
					// need to grabe data from database
					sale.selectRecord(conn, false);
					jsonSale = sale.toJson(null, ctx.mSession.mUser);
					jsonSale.add("LINES", SaleLine.selectSaleLines(conn, false, sale.id(), null));




				}
				
				Store store = new Store(sale.storeId());
				store.selectRecord(conn, false);
				jsonSale.add(D.STORE, store.toJson(null));
				
				/**
				// mainly for customer deposit balance, should save the balance with the sale
				// record, because the deposit in customer record will change
				Customer customer = new Customer(sale.customerId());
				customer.selectRecord(conn, false);
				jsonSale.add(D.CUSTOMER, customer.toJson(null));
				*/
				
				String printResult = null;
				Receipt receipt;
				if( sale.type()==Sale.Type.DEPOSIT ) {
					receipt = new ReceiptDeposit(Attr.OPTIONS_PRINTING.asJsonObject(), jsonSale);
					printResult = receipt.print();					
				}else{
					receipt = new ReceiptSale(Attr.OPTIONS_PRINTING.asJsonObject(), jsonSale);







>
>
>
>
>





>
>
>
>






<
<
<
<
<
<
<
<







1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396








1397
1398
1399
1400
1401
1402
1403
			JsonObject	jsonSale;
			try {
				ctx.mConn=this.mEngine.mRepo.getConnection();
				Connection conn = ctx.mConn;
				if( sale.id()==null ) {
					// this is a unsaved sale, all data are in the JSON already
					jsonSale = jsonReqSale;
					if(sale.customerId()!=null) {
						Customer customer = new Customer(sale.customerId());
						customer.selectRecord(conn, false);
						jsonSale.addProperty(D.Sale.CUSTOMER_DEPOSIT, customer.deposit());
					}
				}else{
					// need to grabe data from database
					sale.selectRecord(conn, false);
					jsonSale = sale.toJson(null, ctx.mSession.mUser);
					jsonSale.add("LINES", SaleLine.selectSaleLines(conn, false, sale.id(), null));

					// for completed sale order, the customer deposit balance after this sale
					// order will be stored in the sale record. It should be saved with the sale
					// record, because the deposit in customer record will change
				}
				
				Store store = new Store(sale.storeId());
				store.selectRecord(conn, false);
				jsonSale.add(D.STORE, store.toJson(null));
				








				String printResult = null;
				Receipt receipt;
				if( sale.type()==Sale.Type.DEPOSIT ) {
					receipt = new ReceiptDeposit(Attr.OPTIONS_PRINTING.asJsonObject(), jsonSale);
					printResult = receipt.print();					
				}else{
					receipt = new ReceiptSale(Attr.OPTIONS_PRINTING.asJsonObject(), jsonSale);