perbaikan data report
This commit is contained in:
@@ -35,24 +35,24 @@ class PurchaseTransaction {
|
||||
});
|
||||
|
||||
PurchaseTransaction.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
partyId = json['party_id'];
|
||||
businessId = json['business_id'];
|
||||
userId = json['user_id'];
|
||||
discountAmount = json['discountAmount'];
|
||||
discountPercent = json['discount_percent'];
|
||||
shippingCharge = json['shipping_charge'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
partyId = num.tryParse(json['party_id']?.toString() ?? '');
|
||||
businessId = num.tryParse(json['business_id']?.toString() ?? '');
|
||||
userId = num.tryParse(json['user_id']?.toString() ?? '');
|
||||
discountAmount = num.tryParse(json['discountAmount']?.toString() ?? '');
|
||||
discountPercent = num.tryParse(json['discount_percent']?.toString() ?? '');
|
||||
shippingCharge = num.tryParse(json['shipping_charge']?.toString() ?? '');
|
||||
discountType = json['discount_type'];
|
||||
dueAmount = json['dueAmount'];
|
||||
changeAmount = json['change_amount'];
|
||||
vatAmount = json['vat_amount'];
|
||||
vatPercent = json['vat_percent'];
|
||||
vatId = json['vat_id'];
|
||||
paidAmount = json['paidAmount'];
|
||||
totalAmount = json['totalAmount'];
|
||||
dueAmount = num.tryParse(json['dueAmount']?.toString() ?? '');
|
||||
changeAmount = num.tryParse(json['change_amount']?.toString() ?? '');
|
||||
vatAmount = num.tryParse(json['vat_amount']?.toString() ?? '');
|
||||
vatPercent = num.tryParse(json['vat_percent']?.toString() ?? '');
|
||||
vatId = num.tryParse(json['vat_id']?.toString() ?? '');
|
||||
paidAmount = num.tryParse(json['paidAmount']?.toString() ?? '');
|
||||
totalAmount = num.tryParse(json['totalAmount']?.toString() ?? '');
|
||||
invoiceNumber = json['invoiceNumber'];
|
||||
isPaid = json['isPaid'];
|
||||
paymentTypeId = int.tryParse(json["payment_type_id"].toString());
|
||||
paymentTypeId = int.tryParse(json["payment_type_id"]?.toString() ?? '');
|
||||
|
||||
vat = json['vat'] != null ? PurchaseVat.fromJson(json['vat']) : null;
|
||||
purchaseDate = json['purchaseDate'];
|
||||
@@ -137,19 +137,19 @@ class PurchaseDetails {
|
||||
});
|
||||
|
||||
PurchaseDetails.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
purchaseId = json['purchase_id'];
|
||||
productId = json['product_id'];
|
||||
productPurchasePrice = json['productPurchasePrice'];
|
||||
quantities = json['quantities'];
|
||||
productDealerPrice = json['productDealerPrice'];
|
||||
productSalePrice = json['productSalePrice'];
|
||||
productStock = json['productStock'];
|
||||
profitPercent = json['profit_percent'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
purchaseId = num.tryParse(json['purchase_id']?.toString() ?? '');
|
||||
productId = num.tryParse(json['product_id']?.toString() ?? '');
|
||||
productPurchasePrice = num.tryParse(json['productPurchasePrice']?.toString() ?? '');
|
||||
quantities = num.tryParse(json['quantities']?.toString() ?? '');
|
||||
productDealerPrice = num.tryParse(json['productDealerPrice']?.toString() ?? '');
|
||||
productSalePrice = num.tryParse(json['productSalePrice']?.toString() ?? '');
|
||||
productStock = num.tryParse(json['productStock']?.toString() ?? '');
|
||||
profitPercent = num.tryParse(json['profit_percent']?.toString() ?? '');
|
||||
mfgDate = json['mfg_date'];
|
||||
expireDate = json['expire_date'];
|
||||
stockId = json['stock_id']; // Added
|
||||
productWholeSalePrice = json['productWholeSalePrice'];
|
||||
stockId = num.tryParse(json['stock_id']?.toString() ?? ''); // Added
|
||||
productWholeSalePrice = num.tryParse(json['productWholeSalePrice']?.toString() ?? '');
|
||||
product = json['product'] != null ? Product.fromJson(json['product']) : null;
|
||||
stock = json['stock'] != null ? PurchaseStock.fromJson(json['stock']) : null;
|
||||
}
|
||||
@@ -198,11 +198,11 @@ class Product {
|
||||
});
|
||||
|
||||
Product.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
productName = json['productName'];
|
||||
productType = json['product_type'];
|
||||
categoryId = json['category_id'];
|
||||
vatAmount = json['vat_amount'];
|
||||
categoryId = num.tryParse(json['category_id']?.toString() ?? '');
|
||||
vatAmount = num.tryParse(json['vat_amount']?.toString() ?? '');
|
||||
vatType = json['vat_type'];
|
||||
|
||||
category = json['category'] != null ? Category.fromJson(json['category']) : null;
|
||||
@@ -238,7 +238,7 @@ class Category {
|
||||
});
|
||||
|
||||
Category.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
categoryName = json['categoryName'];
|
||||
}
|
||||
|
||||
@@ -262,10 +262,10 @@ class PurchaseStock {
|
||||
});
|
||||
|
||||
PurchaseStock.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
batchNo = json['batch_no'] ?? 'N/A';
|
||||
variantName = json['variant_name']; // Added
|
||||
warehouseId = json['warehouse_id']; // Added
|
||||
warehouseId = num.tryParse(json['warehouse_id']?.toString() ?? ''); // Added
|
||||
}
|
||||
|
||||
num? id;
|
||||
@@ -285,7 +285,7 @@ class Party {
|
||||
});
|
||||
|
||||
Party.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
email = json['email'];
|
||||
phone = json['phone'];
|
||||
@@ -320,7 +320,7 @@ class User {
|
||||
});
|
||||
|
||||
User.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
role = json['role'];
|
||||
}
|
||||
@@ -347,7 +347,7 @@ class Branch {
|
||||
});
|
||||
|
||||
Branch.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
phone = json['phone'];
|
||||
address = json['address'];
|
||||
@@ -372,9 +372,9 @@ class PurchaseReturn {
|
||||
});
|
||||
|
||||
PurchaseReturn.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
businessId = json['business_id'];
|
||||
purchaseId = json['purchase_id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
businessId = num.tryParse(json['business_id']?.toString() ?? '');
|
||||
purchaseId = num.tryParse(json['purchase_id']?.toString() ?? '');
|
||||
invoiceNo = json['invoice_no'];
|
||||
returnDate = json['return_date'];
|
||||
createdAt = json['created_at'];
|
||||
@@ -423,12 +423,12 @@ class PurchaseReturnDetails {
|
||||
});
|
||||
|
||||
PurchaseReturnDetails.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
businessId = json['business_id'];
|
||||
purchaseReturnId = json['purchase_return_id'];
|
||||
purchaseDetailId = json['purchase_detail_id'];
|
||||
returnAmount = json['return_amount'];
|
||||
returnQty = json['return_qty'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
businessId = num.tryParse(json['business_id']?.toString() ?? '');
|
||||
purchaseReturnId = num.tryParse(json['purchase_return_id']?.toString() ?? '');
|
||||
purchaseDetailId = num.tryParse(json['purchase_detail_id']?.toString() ?? '');
|
||||
returnAmount = num.tryParse(json['return_amount']?.toString() ?? '');
|
||||
returnQty = num.tryParse(json['return_qty']?.toString() ?? '');
|
||||
}
|
||||
|
||||
num? id;
|
||||
@@ -458,9 +458,9 @@ class PurchaseVat {
|
||||
});
|
||||
|
||||
PurchaseVat.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
rate = json['rate'];
|
||||
rate = num.tryParse(json['rate']?.toString() ?? '');
|
||||
}
|
||||
|
||||
num? id;
|
||||
@@ -475,7 +475,7 @@ class PaymentType {
|
||||
});
|
||||
|
||||
PaymentType.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
}
|
||||
|
||||
@@ -491,9 +491,9 @@ class PurchaseProductVat {
|
||||
});
|
||||
|
||||
PurchaseProductVat.fromJson(dynamic json) {
|
||||
id = json['id'];
|
||||
id = num.tryParse(json['id']?.toString() ?? '');
|
||||
name = json['name'];
|
||||
rate = json['rate'];
|
||||
rate = num.tryParse(json['rate']?.toString() ?? '');
|
||||
}
|
||||
|
||||
num? id;
|
||||
|
||||
Reference in New Issue
Block a user