mirror of
https://github.com/bcomsugi/Quickbooks-API.git
synced 2026-01-09 09:42:40 +07:00
add Customer Query Class
This commit is contained in:
parent
b6883a24c7
commit
bfe33dc45a
236
CustomerQuery.xml
Normal file
236
CustomerQuery.xml
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<?qbxml version="16.0"?>
|
||||||
|
<QBXML>
|
||||||
|
<QBXMLMsgsRq onError="stopOnError">
|
||||||
|
<CustomerQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE">
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<MaxReturned >INTTYPE</MaxReturned> <!-- optional -->
|
||||||
|
<!-- ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All -->
|
||||||
|
<ActiveStatus >ENUMTYPE</ActiveStatus> <!-- optional -->
|
||||||
|
<FromModifiedDate >DATETIMETYPE</FromModifiedDate> <!-- optional -->
|
||||||
|
<ToModifiedDate >DATETIMETYPE</ToModifiedDate> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<NameFilter> <!-- optional -->
|
||||||
|
<!-- MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith -->
|
||||||
|
<MatchCriterion >ENUMTYPE</MatchCriterion> <!-- required -->
|
||||||
|
<Name >STRTYPE</Name> <!-- required -->
|
||||||
|
</NameFilter>
|
||||||
|
<!-- OR -->
|
||||||
|
<NameRangeFilter> <!-- optional -->
|
||||||
|
<FromName >STRTYPE</FromName> <!-- optional -->
|
||||||
|
<ToName >STRTYPE</ToName> <!-- optional -->
|
||||||
|
</NameRangeFilter>
|
||||||
|
<!-- END OR -->
|
||||||
|
<TotalBalanceFilter> <!-- optional -->
|
||||||
|
<!-- Operator may have one of the following values: LessThan, LessThanEqual, Equal, GreaterThan, GreaterThanEqual -->
|
||||||
|
<Operator >ENUMTYPE</Operator> <!-- required -->
|
||||||
|
<Amount >AMTTYPE</Amount> <!-- required -->
|
||||||
|
</TotalBalanceFilter>
|
||||||
|
<CurrencyFilter> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
|
||||||
|
<!-- END OR -->
|
||||||
|
</CurrencyFilter>
|
||||||
|
<ClassFilter> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional -->
|
||||||
|
<!-- END OR -->
|
||||||
|
</ClassFilter>
|
||||||
|
<!-- END OR -->
|
||||||
|
<IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
|
||||||
|
<OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat -->
|
||||||
|
</CustomerQueryRq>
|
||||||
|
|
||||||
|
<CustomerQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE" retCount="INTTYPE" iteratorRemainingCount="INTTYPE" iteratorID="UUIDTYPE">
|
||||||
|
<CustomerRet> <!-- optional, may repeat -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- required -->
|
||||||
|
<TimeCreated >DATETIMETYPE</TimeCreated> <!-- required -->
|
||||||
|
<TimeModified >DATETIMETYPE</TimeModified> <!-- required -->
|
||||||
|
<EditSequence >STRTYPE</EditSequence> <!-- required -->
|
||||||
|
<Name >STRTYPE</Name> <!-- required -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- required -->
|
||||||
|
<IsActive >BOOLTYPE</IsActive> <!-- optional -->
|
||||||
|
<ClassRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ClassRef>
|
||||||
|
<ParentRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ParentRef>
|
||||||
|
<Sublevel >INTTYPE</Sublevel> <!-- required -->
|
||||||
|
<CompanyName >STRTYPE</CompanyName> <!-- optional -->
|
||||||
|
<Salutation >STRTYPE</Salutation> <!-- optional -->
|
||||||
|
<FirstName >STRTYPE</FirstName> <!-- optional -->
|
||||||
|
<MiddleName >STRTYPE</MiddleName> <!-- optional -->
|
||||||
|
<LastName >STRTYPE</LastName> <!-- optional -->
|
||||||
|
<JobTitle >STRTYPE</JobTitle> <!-- optional -->
|
||||||
|
<BillAddress> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
<City >STRTYPE</City> <!-- optional -->
|
||||||
|
<State >STRTYPE</State> <!-- optional -->
|
||||||
|
<PostalCode >STRTYPE</PostalCode> <!-- optional -->
|
||||||
|
<Country >STRTYPE</Country> <!-- optional -->
|
||||||
|
<Note >STRTYPE</Note> <!-- optional -->
|
||||||
|
</BillAddress>
|
||||||
|
<BillAddressBlock> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
</BillAddressBlock>
|
||||||
|
<ShipAddress> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
<City >STRTYPE</City> <!-- optional -->
|
||||||
|
<State >STRTYPE</State> <!-- optional -->
|
||||||
|
<PostalCode >STRTYPE</PostalCode> <!-- optional -->
|
||||||
|
<Country >STRTYPE</Country> <!-- optional -->
|
||||||
|
<Note >STRTYPE</Note> <!-- optional -->
|
||||||
|
</ShipAddress>
|
||||||
|
<ShipAddressBlock> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
</ShipAddressBlock>
|
||||||
|
<ShipToAddress> <!-- must occur 0 - 50 times -->
|
||||||
|
<Name >STRTYPE</Name> <!-- required -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
<City >STRTYPE</City> <!-- optional -->
|
||||||
|
<State >STRTYPE</State> <!-- optional -->
|
||||||
|
<PostalCode >STRTYPE</PostalCode> <!-- optional -->
|
||||||
|
<Country >STRTYPE</Country> <!-- optional -->
|
||||||
|
<Note >STRTYPE</Note> <!-- optional -->
|
||||||
|
<DefaultShipTo >BOOLTYPE</DefaultShipTo> <!-- optional -->
|
||||||
|
</ShipToAddress>
|
||||||
|
<Phone >STRTYPE</Phone> <!-- optional -->
|
||||||
|
<AltPhone >STRTYPE</AltPhone> <!-- optional -->
|
||||||
|
<Fax >STRTYPE</Fax> <!-- optional -->
|
||||||
|
<Email >STRTYPE</Email> <!-- optional -->
|
||||||
|
<Cc >STRTYPE</Cc> <!-- optional -->
|
||||||
|
<Contact >STRTYPE</Contact> <!-- optional -->
|
||||||
|
<AltContact >STRTYPE</AltContact> <!-- optional -->
|
||||||
|
<AdditionalContactRef> <!-- must occur 0 - 8 times -->
|
||||||
|
<ContactName >STRTYPE</ContactName> <!-- required -->
|
||||||
|
<ContactValue >STRTYPE</ContactValue> <!-- required -->
|
||||||
|
</AdditionalContactRef>
|
||||||
|
<ContactsRet> <!-- optional, may repeat -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- required -->
|
||||||
|
<TimeCreated >DATETIMETYPE</TimeCreated> <!-- required -->
|
||||||
|
<TimeModified >DATETIMETYPE</TimeModified> <!-- required -->
|
||||||
|
<EditSequence >STRTYPE</EditSequence> <!-- required -->
|
||||||
|
<Contact >STRTYPE</Contact> <!-- optional -->
|
||||||
|
<Salutation >STRTYPE</Salutation> <!-- optional -->
|
||||||
|
<FirstName >STRTYPE</FirstName> <!-- required -->
|
||||||
|
<MiddleName >STRTYPE</MiddleName> <!-- optional -->
|
||||||
|
<LastName >STRTYPE</LastName> <!-- optional -->
|
||||||
|
<JobTitle >STRTYPE</JobTitle> <!-- optional -->
|
||||||
|
<AdditionalContactRef> <!-- must occur 0 - 5 times -->
|
||||||
|
<ContactName >STRTYPE</ContactName> <!-- required -->
|
||||||
|
<ContactValue >STRTYPE</ContactValue> <!-- required -->
|
||||||
|
</AdditionalContactRef>
|
||||||
|
</ContactsRet>
|
||||||
|
<CustomerTypeRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</CustomerTypeRef>
|
||||||
|
<TermsRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</TermsRef>
|
||||||
|
<SalesRepRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</SalesRepRef>
|
||||||
|
<Balance >AMTTYPE</Balance> <!-- optional -->
|
||||||
|
<TotalBalance >AMTTYPE</TotalBalance> <!-- optional -->
|
||||||
|
<SalesTaxCodeRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</SalesTaxCodeRef>
|
||||||
|
<ItemSalesTaxRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ItemSalesTaxRef>
|
||||||
|
<!-- SalesTaxCountry may have one of the following values: Australia, Canada [DEFAULT], UK, US -->
|
||||||
|
<SalesTaxCountry >ENUMTYPE</SalesTaxCountry> <!-- optional -->
|
||||||
|
<ResaleNumber >STRTYPE</ResaleNumber> <!-- optional -->
|
||||||
|
<AccountNumber >STRTYPE</AccountNumber> <!-- optional -->
|
||||||
|
<CreditLimit >AMTTYPE</CreditLimit> <!-- optional -->
|
||||||
|
<PreferredPaymentMethodRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</PreferredPaymentMethodRef>
|
||||||
|
<CreditCardInfo> <!-- optional -->
|
||||||
|
<CreditCardNumber >STRTYPE</CreditCardNumber> <!-- optional -->
|
||||||
|
<ExpirationMonth >INTTYPE</ExpirationMonth> <!-- optional -->
|
||||||
|
<ExpirationYear >INTTYPE</ExpirationYear> <!-- optional -->
|
||||||
|
<NameOnCard >STRTYPE</NameOnCard> <!-- optional -->
|
||||||
|
<CreditCardAddress >STRTYPE</CreditCardAddress> <!-- optional -->
|
||||||
|
<CreditCardPostalCode >STRTYPE</CreditCardPostalCode> <!-- optional -->
|
||||||
|
</CreditCardInfo>
|
||||||
|
<!-- JobStatus may have one of the following values: Awarded, Closed, InProgress, None [DEFAULT], NotAwarded, Pending -->
|
||||||
|
<JobStatus >ENUMTYPE</JobStatus> <!-- optional -->
|
||||||
|
<JobStartDate >DATETYPE</JobStartDate> <!-- optional -->
|
||||||
|
<JobProjectedEndDate >DATETYPE</JobProjectedEndDate> <!-- optional -->
|
||||||
|
<JobEndDate >DATETYPE</JobEndDate> <!-- optional -->
|
||||||
|
<JobDesc >STRTYPE</JobDesc> <!-- optional -->
|
||||||
|
<JobTypeRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</JobTypeRef>
|
||||||
|
<Notes >STRTYPE</Notes> <!-- optional -->
|
||||||
|
<AdditionalNotesRet> <!-- optional, may repeat -->
|
||||||
|
<NoteID >INTTYPE</NoteID> <!-- required -->
|
||||||
|
<Date >DATETYPE</Date> <!-- required -->
|
||||||
|
<Note >STRTYPE</Note> <!-- required -->
|
||||||
|
</AdditionalNotesRet>
|
||||||
|
<!-- PreferredDeliveryMethod may have one of the following values: None [Default], Email, Fax -->
|
||||||
|
<PreferredDeliveryMethod >ENUMTYPE</PreferredDeliveryMethod> <!-- optional -->
|
||||||
|
<PriceLevelRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</PriceLevelRef>
|
||||||
|
<ExternalGUID >GUIDTYPE</ExternalGUID> <!-- optional -->
|
||||||
|
<TaxRegistrationNumber >STRTYPE</TaxRegistrationNumber> <!-- optional -->
|
||||||
|
<CurrencyRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</CurrencyRef>
|
||||||
|
<DataExtRet> <!-- optional, may repeat -->
|
||||||
|
<OwnerID >GUIDTYPE</OwnerID> <!-- optional -->
|
||||||
|
<DataExtName >STRTYPE</DataExtName> <!-- required -->
|
||||||
|
<!-- DataExtType may have one of the following values: AMTTYPE, DATETIMETYPE, INTTYPE, PERCENTTYPE, PRICETYPE, QUANTYPE, STR1024TYPE, STR255TYPE -->
|
||||||
|
<DataExtType >ENUMTYPE</DataExtType> <!-- required -->
|
||||||
|
<DataExtValue >STRTYPE</DataExtValue> <!-- required -->
|
||||||
|
</DataExtRet>
|
||||||
|
</CustomerRet>
|
||||||
|
</CustomerQueryRs>
|
||||||
|
</QBXMLMsgsRq>
|
||||||
|
</QBXML>
|
||||||
174
InvoiceAdd.xml
Normal file
174
InvoiceAdd.xml
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
<InvoiceAddRq>
|
||||||
|
<InvoiceAdd defMacro="MACROTYPE"> <!-- required -->
|
||||||
|
<CustomerRef> <!-- required -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</CustomerRef>
|
||||||
|
<ClassRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ClassRef>
|
||||||
|
<ARAccountRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ARAccountRef>
|
||||||
|
<TemplateRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</TemplateRef>
|
||||||
|
<TxnDate >DATETYPE</TxnDate> <!-- optional -->
|
||||||
|
<RefNumber >STRTYPE</RefNumber> <!-- optional -->
|
||||||
|
<BillAddress> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
<City >STRTYPE</City> <!-- optional -->
|
||||||
|
<State >STRTYPE</State> <!-- optional -->
|
||||||
|
<PostalCode >STRTYPE</PostalCode> <!-- optional -->
|
||||||
|
<Country >STRTYPE</Country> <!-- optional -->
|
||||||
|
<Note >STRTYPE</Note> <!-- optional -->
|
||||||
|
</BillAddress>
|
||||||
|
<ShipAddress> <!-- optional -->
|
||||||
|
<Addr1 >STRTYPE</Addr1> <!-- optional -->
|
||||||
|
<Addr2 >STRTYPE</Addr2> <!-- optional -->
|
||||||
|
<Addr3 >STRTYPE</Addr3> <!-- optional -->
|
||||||
|
<Addr4 >STRTYPE</Addr4> <!-- optional -->
|
||||||
|
<Addr5 >STRTYPE</Addr5> <!-- optional -->
|
||||||
|
<City >STRTYPE</City> <!-- optional -->
|
||||||
|
<State >STRTYPE</State> <!-- optional -->
|
||||||
|
<PostalCode >STRTYPE</PostalCode> <!-- optional -->
|
||||||
|
<Country >STRTYPE</Country> <!-- optional -->
|
||||||
|
<Note >STRTYPE</Note> <!-- optional -->
|
||||||
|
</ShipAddress>
|
||||||
|
<IsPending >BOOLTYPE</IsPending> <!-- optional -->
|
||||||
|
<IsFinanceCharge >BOOLTYPE</IsFinanceCharge> <!-- optional -->
|
||||||
|
<PONumber >STRTYPE</PONumber> <!-- optional -->
|
||||||
|
<TermsRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</TermsRef>
|
||||||
|
<DueDate >DATETYPE</DueDate> <!-- optional -->
|
||||||
|
<SalesRepRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</SalesRepRef>
|
||||||
|
<FOB >STRTYPE</FOB> <!-- optional -->
|
||||||
|
<ShipDate >DATETYPE</ShipDate> <!-- optional -->
|
||||||
|
<ShipMethodRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ShipMethodRef>
|
||||||
|
<ItemSalesTaxRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ItemSalesTaxRef>
|
||||||
|
<Memo >STRTYPE</Memo> <!-- optional -->
|
||||||
|
<CustomerMsgRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</CustomerMsgRef>
|
||||||
|
<IsToBePrinted >BOOLTYPE</IsToBePrinted> <!-- optional -->
|
||||||
|
<IsToBeEmailed >BOOLTYPE</IsToBeEmailed> <!-- optional -->
|
||||||
|
<IsTaxIncluded >BOOLTYPE</IsTaxIncluded> <!-- optional -->
|
||||||
|
<CustomerSalesTaxCodeRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</CustomerSalesTaxCodeRef>
|
||||||
|
<Other >STRTYPE</Other> <!-- optional -->
|
||||||
|
<ExchangeRate >FLOATTYPE</ExchangeRate> <!-- optional -->
|
||||||
|
<ExternalGUID >GUIDTYPE</ExternalGUID> <!-- optional -->
|
||||||
|
<LinkToTxnID >IDTYPE</LinkToTxnID> <!-- optional, may repeat -->
|
||||||
|
<SetCredit> <!-- optional, may repeat -->
|
||||||
|
<CreditTxnID useMacro="MACROTYPE">IDTYPE</CreditTxnID> <!-- required -->
|
||||||
|
<AppliedAmount >AMTTYPE</AppliedAmount> <!-- required -->
|
||||||
|
<Override >BOOLTYPE</Override> <!-- optional -->
|
||||||
|
</SetCredit>
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<InvoiceLineAdd defMacro="MACROTYPE"> <!-- optional -->
|
||||||
|
<ItemRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ItemRef>
|
||||||
|
<Desc >STRTYPE</Desc> <!-- optional -->
|
||||||
|
<Quantity >QUANTYPE</Quantity> <!-- optional -->
|
||||||
|
<UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<Rate >PRICETYPE</Rate> <!-- optional -->
|
||||||
|
<!-- OR -->
|
||||||
|
<RatePercent >PERCENTTYPE</RatePercent> <!-- optional -->
|
||||||
|
<!-- OR -->
|
||||||
|
<PriceLevelRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</PriceLevelRef>
|
||||||
|
<!-- END OR -->
|
||||||
|
<ClassRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ClassRef>
|
||||||
|
<Amount >AMTTYPE</Amount> <!-- optional -->
|
||||||
|
<!-- OptionForPriceRuleConflict may have one of the following values: Zero, BasePrice -->
|
||||||
|
<OptionForPriceRuleConflict >ENUMTYPE</OptionForPriceRuleConflict> <!-- optional -->
|
||||||
|
<InventorySiteRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</InventorySiteRef>
|
||||||
|
<InventorySiteLocationRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</InventorySiteLocationRef>
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<SerialNumber >STRTYPE</SerialNumber> <!-- optional -->
|
||||||
|
<!-- OR -->
|
||||||
|
<LotNumber >STRTYPE</LotNumber> <!-- optional -->
|
||||||
|
<!-- END OR -->
|
||||||
|
<ServiceDate >DATETYPE</ServiceDate> <!-- optional -->
|
||||||
|
<SalesTaxCodeRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</SalesTaxCodeRef>
|
||||||
|
<OverrideItemAccountRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</OverrideItemAccountRef>
|
||||||
|
<Other1 >STRTYPE</Other1> <!-- optional -->
|
||||||
|
<Other2 >STRTYPE</Other2> <!-- optional -->
|
||||||
|
<LinkToTxn> <!-- optional -->
|
||||||
|
<TxnID >IDTYPE</TxnID> <!-- required -->
|
||||||
|
<TxnLineID >IDTYPE</TxnLineID> <!-- required -->
|
||||||
|
</LinkToTxn>
|
||||||
|
<DataExt> <!-- optional, may repeat -->
|
||||||
|
<OwnerID >GUIDTYPE</OwnerID> <!-- required -->
|
||||||
|
<DataExtName >STRTYPE</DataExtName> <!-- required -->
|
||||||
|
<DataExtValue >STRTYPE</DataExtValue> <!-- required -->
|
||||||
|
</DataExt>
|
||||||
|
</InvoiceLineAdd>
|
||||||
|
<!-- OR -->
|
||||||
|
<InvoiceLineGroupAdd> <!-- optional -->
|
||||||
|
<ItemGroupRef> <!-- required -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</ItemGroupRef>
|
||||||
|
<Quantity >QUANTYPE</Quantity> <!-- optional -->
|
||||||
|
<UnitOfMeasure >STRTYPE</UnitOfMeasure> <!-- optional -->
|
||||||
|
<InventorySiteRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</InventorySiteRef>
|
||||||
|
<InventorySiteLocationRef> <!-- optional -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional -->
|
||||||
|
</InventorySiteLocationRef>
|
||||||
|
<DataExt> <!-- optional, may repeat -->
|
||||||
|
<OwnerID >GUIDTYPE</OwnerID> <!-- required -->
|
||||||
|
<DataExtName >STRTYPE</DataExtName> <!-- required -->
|
||||||
|
<DataExtValue >STRTYPE</DataExtValue> <!-- required -->
|
||||||
|
</DataExt>
|
||||||
|
</InvoiceLineGroupAdd>
|
||||||
|
<!-- END OR -->
|
||||||
|
</InvoiceAdd>
|
||||||
|
<IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
|
||||||
|
</InvoiceAddRq>
|
||||||
|
|
||||||
38
ItemInventoryQuery.xml
Normal file
38
ItemInventoryQuery.xml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<ItemInventoryQueryRq metaData="ENUMTYPE" iterator="ENUMTYPE" iteratorID="UUIDTYPE">
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<MaxReturned >INTTYPE</MaxReturned> <!-- optional -->
|
||||||
|
<!-- ActiveStatus may have one of the following values: ActiveOnly [DEFAULT], InactiveOnly, All -->
|
||||||
|
<ActiveStatus >ENUMTYPE</ActiveStatus> <!-- optional -->
|
||||||
|
<FromModifiedDate >DATETIMETYPE</FromModifiedDate> <!-- optional -->
|
||||||
|
<ToModifiedDate >DATETIMETYPE</ToModifiedDate> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<NameFilter> <!-- optional -->
|
||||||
|
<!-- MatchCriterion may have one of the following values: StartsWith, Contains, EndsWith -->
|
||||||
|
<MatchCriterion >ENUMTYPE</MatchCriterion> <!-- required -->
|
||||||
|
<Name >STRTYPE</Name> <!-- required -->
|
||||||
|
</NameFilter>
|
||||||
|
<!-- OR -->
|
||||||
|
<NameRangeFilter> <!-- optional -->
|
||||||
|
<FromName >STRTYPE</FromName> <!-- optional -->
|
||||||
|
<ToName >STRTYPE</ToName> <!-- optional -->
|
||||||
|
</NameRangeFilter>
|
||||||
|
<!-- END OR -->
|
||||||
|
<ClassFilter> <!-- optional -->
|
||||||
|
<!-- BEGIN OR -->
|
||||||
|
<ListID >IDTYPE</ListID> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullName >STRTYPE</FullName> <!-- optional, may repeat -->
|
||||||
|
<!-- OR -->
|
||||||
|
<ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional -->
|
||||||
|
<!-- OR -->
|
||||||
|
<FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional -->
|
||||||
|
<!-- END OR -->
|
||||||
|
</ClassFilter>
|
||||||
|
<!-- END OR -->
|
||||||
|
<IncludeRetElement >STRTYPE</IncludeRetElement> <!-- optional, may repeat -->
|
||||||
|
<OwnerID >GUIDTYPE</OwnerID> <!-- optional, may repeat -->
|
||||||
|
</ItemInventoryQueryRq>
|
||||||
150
QBClasses.py
150
QBClasses.py
@ -1,5 +1,9 @@
|
|||||||
from server import baseQBQuery
|
from server import baseQBQuery, timing
|
||||||
import pprint
|
import pprint
|
||||||
|
import timeit
|
||||||
|
|
||||||
|
|
||||||
|
# from functools import wraps
|
||||||
|
|
||||||
class ItemInventoryQuery(baseQBQuery):
|
class ItemInventoryQuery(baseQBQuery):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -74,6 +78,40 @@ class GeneralSummaryReportQuery(baseQBQuery):
|
|||||||
print(self.__class__.__name__ + "Rq")
|
print(self.__class__.__name__ + "Rq")
|
||||||
print(f'{self.QBDict = }')
|
print(f'{self.QBDict = }')
|
||||||
|
|
||||||
|
class InvoiceAdd(baseQBQuery):
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
print(f'{args = }')
|
||||||
|
print(f'{kwargs = }')
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.retName = 'InvoiceAddRet'
|
||||||
|
self.reqSubName = self.retName.replace('Ret', '')
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]={}
|
||||||
|
if 'CustomerFullName' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ListID"]=kwargs['ListID']
|
||||||
|
if 'ListID' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ListID"]=kwargs['ListID']
|
||||||
|
elif 'FullName' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["FullName"]=kwargs['FullName']
|
||||||
|
else:
|
||||||
|
if 'MaxReturned' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["MaxReturned"]=kwargs['MaxReturned']
|
||||||
|
if 'ActiveStatus' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ActiveStatus"]=kwargs['ActiveStatus']
|
||||||
|
if 'FromModifiedDate' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["FromModifiedDate"]=kwargs['FromModifiedDate']
|
||||||
|
if 'ToModifiedDate' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ToModifiedDate"]=kwargs['ToModifiedDate']
|
||||||
|
if 'MatchCriterion' in kwargs and 'Name' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["NameFilter"]={'MatchCriterion':kwargs['MatchCriterion', 'Name':kwargs['Name']]}
|
||||||
|
if 'FromName' in kwargs or 'ToName' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["NameRangeFilter"]={'FromName':kwargs.get('FromName', ""), 'ToName':kwargs.get('ToName', "")}
|
||||||
|
if 'IncludeRetElement' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["IncludeRetElement"]=kwargs['IncludeRetElement']
|
||||||
|
if 'OwnerID' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["OwnerID"]=kwargs['OwnerID']
|
||||||
|
|
||||||
|
# print(self.__class__.__name__ + "Rq")
|
||||||
|
# print(self.QBDict)
|
||||||
|
|
||||||
# x=ItemInventoryQuery('bagus', 'kedua', key5=5, key2="hore", FullName1='hooooo', FromName1="sg", ToName1="sugi", IncludeRetElement1=['Name', 'FullName'], MaxReturned="2")
|
# x=ItemInventoryQuery('bagus', 'kedua', key5=5, key2="hore", FullName1='hooooo', FromName1="sg", ToName1="sugi", IncludeRetElement1=['Name', 'FullName'], MaxReturned="2")
|
||||||
# x.create_QBXML()
|
# x.create_QBXML()
|
||||||
@ -112,7 +150,109 @@ class GeneralSummaryReportQuery(baseQBQuery):
|
|||||||
# print(a2)
|
# print(a2)
|
||||||
# print(a1)
|
# print(a1)
|
||||||
|
|
||||||
g= GeneralSummaryReportQuery(GeneralSummaryReportType="ProfitAndLossStandard", ReportDateMacro="ThisYear")
|
class CustomerQuery(baseQBQuery):
|
||||||
print(type(g.all()))
|
def __init__(self, *args, **kwargs):
|
||||||
print(g.all())
|
print(f'{args = }')
|
||||||
pprint.pprint(g.filter("ColData").all())
|
print(f'{kwargs = }')
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.onError = "stopOnError"
|
||||||
|
self.retName = 'CustomerRet'
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]={}
|
||||||
|
if 'ListID' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ListID"]=kwargs['ListID']
|
||||||
|
elif 'FullName' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["FullName"]=kwargs['FullName']
|
||||||
|
else:
|
||||||
|
if 'MaxReturned' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["MaxReturned"]=kwargs['MaxReturned']
|
||||||
|
if 'ActiveStatus' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ActiveStatus"]=kwargs['ActiveStatus']
|
||||||
|
if 'FromModifiedDate' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["FromModifiedDate"]=kwargs['FromModifiedDate']
|
||||||
|
if 'ToModifiedDate' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["ToModifiedDate"]=kwargs['ToModifiedDate']
|
||||||
|
if 'MatchCriterion' in kwargs and 'Name' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["NameFilter"]={'MatchCriterion':kwargs['MatchCriterion'], 'Name':kwargs['Name']}
|
||||||
|
elif 'FromName' in kwargs or 'ToName' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["NameRangeFilter"]={'FromName':kwargs.get('FromName', ""), 'ToName':kwargs.get('ToName', "")}
|
||||||
|
|
||||||
|
if 'Operator' in kwargs and 'Amount' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["TotalBalanceFilter"]={'Operator':kwargs['Operator'], 'Amount':kwargs['Amount']}
|
||||||
|
if 'IncludeRetElement' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["IncludeRetElement"]=kwargs['IncludeRetElement']
|
||||||
|
if 'OwnerID' in kwargs:
|
||||||
|
self.QBDict[self.__class__.__name__ + "Rq"]["OwnerID"]=kwargs['OwnerID']
|
||||||
|
|
||||||
|
print(self.__class__.__name__ + "Rq")
|
||||||
|
print(self.QBDict)
|
||||||
|
|
||||||
|
|
||||||
|
@timing
|
||||||
|
def main():
|
||||||
|
g= GeneralSummaryReportQuery(GeneralSummaryReportType="ProfitAndLossStandard", ReportDateMacro="ThisYear")
|
||||||
|
print(type(g.all()))
|
||||||
|
print(g.all())
|
||||||
|
pprint.pprint(g.filter("ColData").all())
|
||||||
|
|
||||||
|
def customerquery():
|
||||||
|
g= CustomerQuery(MaxReturned=3, IncludeRetElement=["FullName", "Name", "CompanyName", "BillAddressBlock", "ShipAddress"])
|
||||||
|
print("init finish")
|
||||||
|
print(f'{type(g.all()) = }')
|
||||||
|
print("before g.all")
|
||||||
|
print(f'{g.all() = }')
|
||||||
|
# print("after g.all")
|
||||||
|
# pprint.pprint(g.filter("ColData").all())
|
||||||
|
|
||||||
|
def readxmltodict():
|
||||||
|
import xmltodict
|
||||||
|
filename="ItemInventoryQuery.xml"
|
||||||
|
filename="InvoiceAdd.xml"
|
||||||
|
with open(filename, "r") as f:
|
||||||
|
xml = f.read()
|
||||||
|
print(xml)
|
||||||
|
print("")
|
||||||
|
print("")
|
||||||
|
with open(filename, "r") as f:
|
||||||
|
xmllines = f.readlines()
|
||||||
|
print(xmllines)
|
||||||
|
varDict = xmltodict.parse(xml)
|
||||||
|
# print(f"{varDict = }")
|
||||||
|
print()
|
||||||
|
f = open(filename)
|
||||||
|
enumDict ={}
|
||||||
|
def recursiveDict(varDict, f, enumDict):
|
||||||
|
# print(varDict)
|
||||||
|
for dKey in varDict:
|
||||||
|
print(dKey)
|
||||||
|
if not isinstance(varDict[dKey], (list, dict)):
|
||||||
|
if dKey[0]=='@' or dKey[0]=="#":
|
||||||
|
continue
|
||||||
|
_ = f.readline()
|
||||||
|
dKey = dKey.replace("#", "")
|
||||||
|
print(dKey)
|
||||||
|
# print(f'{dKey = }, {varDict[dKey]}, {_}')
|
||||||
|
_strOptional = ""
|
||||||
|
while not dKey in _:
|
||||||
|
_ = f.readline()
|
||||||
|
# print(f'{dKey = }, {varDict[dKey]}, {_}')
|
||||||
|
if "values:" in _:
|
||||||
|
enumDict[dKey]=_.split(":")[-1].replace("[DEFAULT]","").replace("-->","").replace(" ","").replace("\n","").split(",")
|
||||||
|
_ = f.readline()
|
||||||
|
_strOptional = _.split("--")[1].strip()
|
||||||
|
varDict[dKey]+=";"+_strOptional
|
||||||
|
print(f'{varDict[dKey] = }')
|
||||||
|
elif isinstance(varDict[dKey], dict):
|
||||||
|
varDict[dKey], enumDict=recursiveDict(varDict[dKey], f, enumDict)##### istirahat dulu ah
|
||||||
|
return varDict, enumDict
|
||||||
|
print(f'{varDict = }')
|
||||||
|
print()
|
||||||
|
print(recursiveDict(varDict, f, enumDict))
|
||||||
|
f.close
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
# main()
|
||||||
|
customerquery()
|
||||||
|
# readxmltodict()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
20
server.py
20
server.py
@ -3,6 +3,20 @@ import xmltodict
|
|||||||
import win32com.client
|
import win32com.client
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
from time import time
|
||||||
|
|
||||||
|
def timing(f):
|
||||||
|
# @wraps(f)
|
||||||
|
def wrap(*args, **kw):
|
||||||
|
ts = time()
|
||||||
|
result = f(*args, **kw)
|
||||||
|
te = time()
|
||||||
|
print('func:%r args:[%r, %r] took: %2.6f sec' % \
|
||||||
|
(f.__name__, args, kw, te-ts))
|
||||||
|
return result
|
||||||
|
return wrap
|
||||||
|
|
||||||
|
|
||||||
class baseQBQuery:
|
class baseQBQuery:
|
||||||
def __init__(self, *args, **kwargs, ) -> None:
|
def __init__(self, *args, **kwargs, ) -> None:
|
||||||
# print(f'{kwargs = }')
|
# print(f'{kwargs = }')
|
||||||
@ -18,7 +32,8 @@ class baseQBQuery:
|
|||||||
self.statusCode = -1
|
self.statusCode = -1
|
||||||
self.statusMessage = ""
|
self.statusMessage = ""
|
||||||
self.statusSeverity = ""
|
self.statusSeverity = ""
|
||||||
|
|
||||||
|
@timing
|
||||||
def create_QBXML(self):
|
def create_QBXML(self):
|
||||||
dataDict = { ### Header for qmxml with version attribute
|
dataDict = { ### Header for qmxml with version attribute
|
||||||
"?qbxml": {
|
"?qbxml": {
|
||||||
@ -50,7 +65,8 @@ class baseQBQuery:
|
|||||||
self.QBXML = xmltodict.unparse(dataDict, pretty=True).replace("</?qbxml>", "")
|
self.QBXML = xmltodict.unparse(dataDict, pretty=True).replace("</?qbxml>", "")
|
||||||
print(self.QBXML)
|
print(self.QBXML)
|
||||||
return self.QBXML
|
return self.QBXML
|
||||||
|
|
||||||
|
@timing
|
||||||
def connect_to_quickbooks(self, qbxml_query=None):
|
def connect_to_quickbooks(self, qbxml_query=None):
|
||||||
# Connect to Quickbooks
|
# Connect to Quickbooks
|
||||||
sessionManager = win32com.client.Dispatch("QBXMLRP2.RequestProcessor")
|
sessionManager = win32com.client.Dispatch("QBXMLRP2.RequestProcessor")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user